avoid error on missing compute state in checkKey

This improves eg `git-annex move --to` a compute remote that does not
contain the key. Rather than erroring with "Missing compute state" when
it checks if the key is in the remote, it proceeds to trying to store to
it, which has a nice error message.
This commit is contained in:
Joey Hess 2025-03-11 11:49:47 -04:00
parent 0477a8d098
commit 5760a15c7c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -756,9 +756,7 @@ avoidCycles outputkeys inputkey = filterM go
checkKey :: RemoteStateHandle -> Key -> Annex Bool
checkKey rs k = do
states <- getComputeStatesUnsorted rs k
if null states
then giveup "Missing compute state"
else return True
return (not (null states))
-- Unsetting the compute state will prevent computing the key.
dropKey :: RemoteStateHandle -> Maybe SafeDropProof -> Key -> Annex ()