aboutsummaryrefslogtreecommitdiff
path: root/Git/UpdateIndex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-04 18:47:31 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-04 18:47:31 -0400
commit743c35709de77055a3e4947d673219569cd57fb4 (patch)
tree6133ddd1497576198df35ae66df27a9416129454 /Git/UpdateIndex.hs
parentcedb6dc503441bfe54881ec646d86dd777635e7d (diff)
more zombie fighting
I'm down to 9 places in the code that can produce unwaited for zombies. Most of these are pretty innocuous, at least for now, are only used in short-running commands, or commands that run a set of actions and explicitly reap zombies after each one. The one from Annex.Branch.files could be trouble later, since both Command.Fsck and Command.Unused can trigger it, and the assistant will be doing those eventally. Ditto the one in Git.LsTree.lsTree, which Command.Unused uses. The only ones currently affecting the assistant though, are in Git.LsFiles. Several threads use several of those. (And yeah, using pipes or ResourceT would be a less ad-hoc approach, but I don't really feel like ripping my entire code base apart right now to change a foundation monad. Maybe one of these days..)
Diffstat (limited to 'Git/UpdateIndex.hs')
-rw-r--r--Git/UpdateIndex.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Git/UpdateIndex.hs b/Git/UpdateIndex.hs
index 69e5f1b3d..bc96570de 100644
--- a/Git/UpdateIndex.hs
+++ b/Git/UpdateIndex.hs
@@ -48,7 +48,10 @@ streamUpdateIndex repo as = pipeWrite params repo $ \h -> do
{- A streamer that adds the current tree for a ref. Useful for eg, copying
- and modifying branches. -}
lsTree :: Ref -> Repo -> Streamer
-lsTree (Ref x) repo streamer = mapM_ streamer =<< pipeNullSplit params repo
+lsTree (Ref x) repo streamer = do
+ (s, cleanup) <- pipeNullSplit params repo
+ mapM_ streamer s
+ void $ cleanup
where
params = map Param ["ls-tree", "-z", "-r", "--full-tree", x]