summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-27 17:40:21 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-27 17:40:21 -0400
commit454b6c96dee4b854decdcda78c6c2b11fd43c21b (patch)
treec9e0f24887b17bc3fa7f4cf74cfd537ef1fe58c2 /Command
parent937aa0b3f16f3b6f07678acbd380c23b9a9085dc (diff)
Fix bogus failure of fsck --fast.
Diffstat (limited to 'Command')
-rw-r--r--Command/Fsck.hs20
1 files changed, 11 insertions, 9 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 39dba08dd..eea0ebc11 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -112,14 +112,15 @@ performRemote key file backend numcopies remote =
dispatch (Left err) = do
showNote err
return False
- dispatch (Right True) = withtmp $ \tmpfile ->
- ifM (getfile tmpfile)
- ( go True (Just tmpfile)
- , do
+ dispatch (Right True) = withtmp $ \tmpfile -> do
+ r <- getfile tmpfile
+ case r of
+ Nothing -> go True Nothing
+ Just True -> go True (Just tmpfile)
+ Just False -> do
warning "failed to download file from remote"
void $ go True Nothing
return False
- )
dispatch (Right False) = go False Nothing
go present localcopy = check
[ verifyLocationLogRemote key file remote present
@@ -137,13 +138,14 @@ performRemote key file backend numcopies remote =
cleanup `after` a tmp
getfile tmp = ifM (checkDiskSpace (Just tmp) key 0)
( ifM (Remote.retrieveKeyFileCheap remote key tmp)
- ( return True
+ ( return (Just True)
, ifM (Annex.getState Annex.fast)
- ( return False
- , Remote.retrieveKeyFile remote key Nothing tmp dummymeter
+ ( return Nothing
+ , Just <$>
+ Remote.retrieveKeyFile remote key Nothing tmp dummymeter
)
)
- , return False
+ , return (Just False)
)
dummymeter _ = noop