diff options
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r-- | Command/Fsck.hs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index bc7a29f15..7884f0477 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -103,15 +103,13 @@ checkDeadRepo u = earlyWarning "Warning: Fscking a repository that is currently marked as dead." start :: Maybe Remote -> Incremental -> FilePath -> Key -> CommandStart -start from inc file key = do - v <- Backend.getBackend file key - case v of - Nothing -> stop - Just backend -> do - numcopies <- getFileNumCopies file - case from of - Nothing -> go $ perform key file backend numcopies - Just r -> go $ performRemote key afile backend numcopies r +start from inc file key = Backend.getBackend file key >>= \case + Nothing -> stop + Just backend -> do + numcopies <- getFileNumCopies file + case from of + Nothing -> go $ perform key file backend numcopies + Just r -> go $ performRemote key afile backend numcopies r where go = runFsck inc (mkActionItem afile) key afile = AssociatedFile (Just file) @@ -142,9 +140,8 @@ performRemote key afile backend numcopies remote = dispatch (Left err) = do showNote err return False - dispatch (Right True) = withtmp $ \tmpfile -> do - r <- getfile tmpfile - case r of + dispatch (Right True) = withtmp $ \tmpfile -> + getfile tmpfile >>= \case Nothing -> go True Nothing Just True -> go True (Just tmpfile) Just False -> do |