From: Joey Hess Date: Tue, 15 Dec 2015 18:27:20 +0000 (-0400) Subject: changes for v6 broke fsck in direct mode X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~320^2~184^2~41 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0ddcaae9c11dc77ac885c5851e4f78940e668ba1;p=git-annex.git changes for v6 broke fsck in direct mode --- diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 74e83670c1..42bc930749 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -299,15 +299,12 @@ verifyDirectMode key file = do -} checkKeySize :: Key -> KeyStatus -> Annex Bool checkKeySize _ KeyUnlocked = return True -checkKeySize key KeyLocked = ifM isDirect - ( return True - , do - file <- calcRepo $ gitAnnexLocation key - ifM (liftIO $ doesFileExist file) - ( checkKeySizeOr badContent key file - , return True - ) - ) +checkKeySize key KeyLocked = do + file <- calcRepo $ gitAnnexLocation key + ifM (liftIO $ doesFileExist file) + ( checkKeySizeOr badContent key file + , return True + ) checkKeySizeRemote :: Key -> Remote -> Maybe FilePath -> Annex Bool checkKeySizeRemote _ _ Nothing = return True @@ -606,8 +603,11 @@ isKeyUnlocked KeyUnlocked = True isKeyUnlocked KeyLocked = False getKeyStatus :: Key -> Annex KeyStatus -getKeyStatus key = do - obj <- calcRepo $ gitAnnexLocation key - unlocked <- ((> 1) . linkCount <$> liftIO (getFileStatus obj)) - <&&> (not . null <$> Database.Keys.getAssociatedFiles key) - return $ if unlocked then KeyUnlocked else KeyLocked +getKeyStatus key = ifM isDirect + ( return KeyUnlocked + , do + obj <- calcRepo $ gitAnnexLocation key + unlocked <- ((> 1) . linkCount <$> liftIO (getFileStatus obj)) + <&&> (not . null <$> Database.Keys.getAssociatedFiles key) + return $ if unlocked then KeyUnlocked else KeyLocked + )