testremote: Really fsck downloaded objects

8844372c23 exposted a bug in testremote, it
was passing the serialized key, not the object file, to be checksummed.
This commit is contained in:
Joey Hess 2024-05-15 17:57:27 -04:00
parent e154c6da92
commit 768cdee461
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 4 additions and 1 deletions

View file

@ -4,6 +4,7 @@ git-annex (10.20240431) UNRELEASED; urgency=medium
whose content is not present.
* Avoid the --fast option preventing checksumming in some cases it
was not supposed to.
* testremote: Really fsck downloaded objects.
* Typo fixes.
Thanks, Yaroslav Halchenko

View file

@ -295,7 +295,9 @@ test runannex mkr mkk =
Nothing -> return True
Just b -> case Types.Backend.verifyKeyContent b of
Nothing -> return True
Just verifier -> verifier k (serializeKey' k)
Just verifier -> do
loc <- Annex.calcRepo (gitAnnexLocation k)
verifier k loc
get r k = logStatusAfter k $ getViaTmp (Remote.retrievalSecurityPolicy r) (RemoteVerify r) k (AssociatedFile Nothing) Nothing $ \dest ->
tryNonAsync (Remote.retrieveKeyFile r k (AssociatedFile Nothing) (fromRawFilePath dest) nullMeterUpdate (RemoteVerify r)) >>= \case
Right v -> return (True, v)