summaryrefslogtreecommitdiff
path: root/Annex/Branch.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Branch.hs')
-rw-r--r--Annex/Branch.hs22
1 files changed, 10 insertions, 12 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index 5f3c71b1a..0dc360c54 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -446,18 +446,16 @@ stageJournal jl = withIndex $ do
[genstream dir h jh jlogh]
return $ cleanup dir jlogh jlogf
where
- genstream dir h jh jlogh streamer = do
- v <- readDirectory jh
- case v of
- Nothing -> return ()
- Just file -> do
- unless (dirCruft file) $ do
- let path = dir </> file
- sha <- Git.HashObject.hashFile h path
- hPutStrLn jlogh file
- streamer $ Git.UpdateIndex.updateIndexLine
- sha FileBlob (asTopFilePath $ fileJournal file)
- genstream dir h jh jlogh streamer
+ genstream dir h jh jlogh streamer = readDirectory jh >>= \case
+ Nothing -> return ()
+ Just file -> do
+ unless (dirCruft file) $ do
+ let path = dir </> file
+ sha <- Git.HashObject.hashFile h path
+ hPutStrLn jlogh file
+ streamer $ Git.UpdateIndex.updateIndexLine
+ sha FileBlob (asTopFilePath $ fileJournal file)
+ genstream dir h jh jlogh streamer
-- Clean up the staged files, as listed in the temp log file.
-- The temp file is used to avoid needing to buffer all the
-- filenames in memory.