changes for v6 broke fsck in direct mode
This commit is contained in:
parent
3ba6d84559
commit
0ddcaae9c1
1 changed files with 14 additions and 14 deletions
|
@ -299,15 +299,12 @@ 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 = ifM isDirect
|
checkKeySize key KeyLocked = do
|
||||||
( return True
|
file <- calcRepo $ gitAnnexLocation key
|
||||||
, do
|
ifM (liftIO $ doesFileExist file)
|
||||||
file <- calcRepo $ gitAnnexLocation key
|
( checkKeySizeOr badContent key file
|
||||||
ifM (liftIO $ doesFileExist file)
|
, return True
|
||||||
( checkKeySizeOr badContent key file
|
)
|
||||||
, return True
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
checkKeySizeRemote :: Key -> Remote -> Maybe FilePath -> Annex Bool
|
checkKeySizeRemote :: Key -> Remote -> Maybe FilePath -> Annex Bool
|
||||||
checkKeySizeRemote _ _ Nothing = return True
|
checkKeySizeRemote _ _ Nothing = return True
|
||||||
|
@ -606,8 +603,11 @@ isKeyUnlocked KeyUnlocked = True
|
||||||
isKeyUnlocked KeyLocked = False
|
isKeyUnlocked KeyLocked = False
|
||||||
|
|
||||||
getKeyStatus :: Key -> Annex KeyStatus
|
getKeyStatus :: Key -> Annex KeyStatus
|
||||||
getKeyStatus key = do
|
getKeyStatus key = ifM isDirect
|
||||||
obj <- calcRepo $ gitAnnexLocation key
|
( return KeyUnlocked
|
||||||
unlocked <- ((> 1) . linkCount <$> liftIO (getFileStatus obj))
|
, do
|
||||||
<&&> (not . null <$> Database.Keys.getAssociatedFiles key)
|
obj <- calcRepo $ gitAnnexLocation key
|
||||||
return $ if unlocked then KeyUnlocked else KeyLocked
|
unlocked <- ((> 1) . linkCount <$> liftIO (getFileStatus obj))
|
||||||
|
<&&> (not . null <$> Database.Keys.getAssociatedFiles key)
|
||||||
|
return $ if unlocked then KeyUnlocked else KeyLocked
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue