From 2a9c5f62e3e2676922905f09b1f2ca535354d884 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Dec 2015 16:10:48 -0400 Subject: recent fsck changes caused ugly message when object was not present --- Command/Fsck.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Command') diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 42bc93074..46de4ac96 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -299,7 +299,7 @@ verifyDirectMode key file = do -} checkKeySize :: Key -> KeyStatus -> Annex Bool checkKeySize _ KeyUnlocked = return True -checkKeySize key KeyLocked = do +checkKeySize key _ = do file <- calcRepo $ gitAnnexLocation key ifM (liftIO $ doesFileExist file) ( checkKeySizeOr badContent key file @@ -596,16 +596,17 @@ withFsckDb NonIncremental _ = noop withFsckDb (ScheduleIncremental _ _ i) a = withFsckDb i a #endif -data KeyStatus = KeyLocked | KeyUnlocked +data KeyStatus = KeyLocked | KeyUnlocked | KeyMissing isKeyUnlocked :: KeyStatus -> Bool isKeyUnlocked KeyUnlocked = True isKeyUnlocked KeyLocked = False +isKeyUnlocked KeyMissing = False getKeyStatus :: Key -> Annex KeyStatus getKeyStatus key = ifM isDirect ( return KeyUnlocked - , do + , catchDefaultIO KeyMissing $ do obj <- calcRepo $ gitAnnexLocation key unlocked <- ((> 1) . linkCount <$> liftIO (getFileStatus obj)) <&&> (not . null <$> Database.Keys.getAssociatedFiles key) -- cgit v1.2.3