recent fsck changes caused ugly message when object was not present
This commit is contained in:
parent
db8b32254c
commit
99f1d7991d
1 changed files with 4 additions and 3 deletions
|
@ -299,7 +299,7 @@ verifyDirectMode key file = do
|
||||||
-}
|
-}
|
||||||
checkKeySize :: Key -> KeyStatus -> Annex Bool
|
checkKeySize :: Key -> KeyStatus -> Annex Bool
|
||||||
checkKeySize _ KeyUnlocked = return True
|
checkKeySize _ KeyUnlocked = return True
|
||||||
checkKeySize key KeyLocked = do
|
checkKeySize key _ = do
|
||||||
file <- calcRepo $ gitAnnexLocation key
|
file <- calcRepo $ gitAnnexLocation key
|
||||||
ifM (liftIO $ doesFileExist file)
|
ifM (liftIO $ doesFileExist file)
|
||||||
( checkKeySizeOr badContent key file
|
( checkKeySizeOr badContent key file
|
||||||
|
@ -596,16 +596,17 @@ withFsckDb NonIncremental _ = noop
|
||||||
withFsckDb (ScheduleIncremental _ _ i) a = withFsckDb i a
|
withFsckDb (ScheduleIncremental _ _ i) a = withFsckDb i a
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
data KeyStatus = KeyLocked | KeyUnlocked
|
data KeyStatus = KeyLocked | KeyUnlocked | KeyMissing
|
||||||
|
|
||||||
isKeyUnlocked :: KeyStatus -> Bool
|
isKeyUnlocked :: KeyStatus -> Bool
|
||||||
isKeyUnlocked KeyUnlocked = True
|
isKeyUnlocked KeyUnlocked = True
|
||||||
isKeyUnlocked KeyLocked = False
|
isKeyUnlocked KeyLocked = False
|
||||||
|
isKeyUnlocked KeyMissing = False
|
||||||
|
|
||||||
getKeyStatus :: Key -> Annex KeyStatus
|
getKeyStatus :: Key -> Annex KeyStatus
|
||||||
getKeyStatus key = ifM isDirect
|
getKeyStatus key = ifM isDirect
|
||||||
( return KeyUnlocked
|
( return KeyUnlocked
|
||||||
, do
|
, catchDefaultIO KeyMissing $ do
|
||||||
obj <- calcRepo $ gitAnnexLocation key
|
obj <- calcRepo $ gitAnnexLocation key
|
||||||
unlocked <- ((> 1) . linkCount <$> liftIO (getFileStatus obj))
|
unlocked <- ((> 1) . linkCount <$> liftIO (getFileStatus obj))
|
||||||
<&&> (not . null <$> Database.Keys.getAssociatedFiles key)
|
<&&> (not . null <$> Database.Keys.getAssociatedFiles key)
|
||||||
|
|
Loading…
Add table
Reference in a new issue