diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-12-15 14:27:20 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-12-15 14:27:20 -0400 |
commit | 271fe1ce457447b0aee8d825b9186a0b579b56d0 (patch) | |
tree | 98e27d433ee21070602469fc8db2185fdc902504 | |
parent | 29a99b09d2c684c2fd519b2b056ade1947dfaace (diff) |
changes for v6 broke fsck in direct mode
-rw-r--r-- | Command/Fsck.hs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 74e83670c..42bc93074 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 + ) |