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 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. * Typo fixes.
Thanks, Yaroslav Halchenko Thanks, Yaroslav Halchenko

View file

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