summaryrefslogtreecommitdiff
path: root/Git/Branch.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-04 18:04:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-04 18:04:09 -0400
commitcedb6dc503441bfe54881ec646d86dd777635e7d (patch)
tree7643d8ca5248b750b99b7c6aeaea4205137127fc /Git/Branch.hs
parent929f2a0df8f76caa21f94ea3afe8afc1d2dba14e (diff)
make a pipeReadStrict, that properly waits on the process
Nearly everything that's reading from git is operating on a small amount of output and has been switched to use that. Only pipeNullSplit stuff continues using the lazy version that yields zombies.
Diffstat (limited to 'Git/Branch.hs')
-rw-r--r--Git/Branch.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Git/Branch.hs b/Git/Branch.hs
index f73ae5e2a..3407845d1 100644
--- a/Git/Branch.hs
+++ b/Git/Branch.hs
@@ -27,7 +27,7 @@ current r = do
case v of
Nothing -> return Nothing
Just branch ->
- ifM (null <$> pipeRead [Param "show-ref", Param $ show branch] r)
+ ifM (null <$> pipeReadStrict [Param "show-ref", Param $ show branch] r)
( return Nothing
, return v
)
@@ -35,7 +35,7 @@ current r = do
{- The current branch, which may not really exist yet. -}
currentUnsafe :: Repo -> IO (Maybe Git.Ref)
currentUnsafe r = parse . firstLine
- <$> pipeRead [Param "symbolic-ref", Param "HEAD"] r
+ <$> pipeReadStrict [Param "symbolic-ref", Param "HEAD"] r
where
parse l
| null l = Nothing
@@ -48,7 +48,7 @@ changed origbranch newbranch repo
| origbranch == newbranch = return False
| otherwise = not . null <$> diffs
where
- diffs = pipeRead
+ diffs = pipeReadStrict
[ Param "log"
, Param (show origbranch ++ ".." ++ show newbranch)
, Params "--oneline -n1"
@@ -93,7 +93,7 @@ fastForward branch (first:rest) repo =
commit :: String -> Branch -> [Ref] -> Repo -> IO Sha
commit message branch parentrefs repo = do
tree <- getSha "write-tree" $
- pipeRead [Param "write-tree"] repo
+ pipeReadStrict [Param "write-tree"] repo
sha <- getSha "commit-tree" $ pipeWriteRead
(map Param $ ["commit-tree", show tree] ++ ps)
message repo