diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-12 21:41:37 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-12 21:41:37 -0400 |
commit | 46588674b081cd4ea5820680d8fc15c81ed175ad (patch) | |
tree | 29055caae381eb6a2bb857a258ec43caecb4df11 /Annex | |
parent | 0e45b762a07d12dbc099936a8481bda9c02d0318 (diff) |
avoid closing pipe before all the shas are read from it
Could have just used hGetContentsStrict here, but that would require
storing all the shas in memory. Since this is called at the end of a
git-annex run, it may have created a *lot* of shas, so I avoid that memory
use and stream them out like before.
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Branch.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs index 556df976f..f9fa6cbb3 100644 --- a/Annex/Branch.hs +++ b/Annex/Branch.hs @@ -291,9 +291,10 @@ stageJournal = do withIndex $ liftIO $ do let dir = gitAnnexJournalDir g let paths = map (dir </>) fs - shas <- Git.HashObject.hashFiles paths g + (shas, cleanup) <- Git.HashObject.hashFiles paths g Git.UnionMerge.update_index g $ index_lines shas (map fileJournal fs) + cleanup mapM_ removeFile paths where index_lines shas = map genline . zip shas |