fsck: Fix recent reversion that made it say it was checksumming files whose content is not present

Did not track down the commit that caused the problem, but git-annex
version 10.20240431 didn't behave that way.
This commit is contained in:
Joey Hess 2024-05-12 21:23:27 -04:00
parent 4007d7234b
commit 05684bdd6c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 15 additions and 10 deletions

View file

@ -1,5 +1,7 @@
git-annex (10.20240431) UNRELEASED; urgency=medium
* fsck: Fix recent reversion that made it say it was checksumming files
whose content is not present.
* Typo fixes.
Thanks, Yaroslav Halchenko

View file

@ -504,16 +504,19 @@ checkKeyUpgrade _ _ _ (AssociatedFile Nothing) =
checkBackend :: Key -> KeyStatus -> AssociatedFile -> Annex Bool
checkBackend key keystatus afile = do
content <- calcRepo (gitAnnexLocation key)
ifM (pure (isKeyUnlockedThin keystatus) <&&> (not <$> isUnmodified key content))
( nocheck
, do
mic <- withTSDelta (liftIO . genInodeCache content)
ifM (checkBackendOr badContent key content ai)
( do
checkInodeCache key content mic ai
return True
, return False
)
ifM (liftIO $ R.doesPathExist content)
( ifM (pure (isKeyUnlockedThin keystatus) <&&> (not <$> isUnmodified key content))
( nocheck
, do
mic <- withTSDelta (liftIO . genInodeCache content)
ifM (checkBackendOr badContent key content ai)
( do
checkInodeCache key content mic ai
return True
, return False
)
)
, nocheck
)
where
nocheck = return True