aboutsummaryrefslogtreecommitdiff
path: root/Git/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-17 14:40:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-17 14:40:05 -0400
commit182526ff68b1ca68952b4dbd32121e46d4a80e85 (patch)
treeecd7097dca179776a5a92e0da11e7bebe01c6d37 /Git/Command.hs
parent1d5582091e9df550a8b42d0a69bada1d15a1825e (diff)
add debugging
Diffstat (limited to 'Git/Command.hs')
-rw-r--r--Git/Command.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/Git/Command.hs b/Git/Command.hs
index 35f0838ba..9a09300e2 100644
--- a/Git/Command.hs
+++ b/Git/Command.hs
@@ -57,16 +57,18 @@ pipeWrite params s repo = assertLocal repo $ do
hClose h
return p
-{- Runs a git subcommand, feeding it input, and returning its output.
- - You should call either getProcessStatus or forceSuccess on the PipeHandle. -}
-pipeWriteRead :: [CommandParam] -> String -> Repo -> IO (PipeHandle, String)
+{- Runs a git subcommand, feeding it input, and returning its output,
+ - which is expected to be fairly small, since it's all read into memory
+ - strictly. -}
+pipeWriteRead :: [CommandParam] -> String -> Repo -> IO String
pipeWriteRead params s repo = assertLocal repo $ do
(p, from, to) <- hPipeBoth "git" (toCommand $ gitCommandLine params repo)
fileEncoding to
fileEncoding from
_ <- forkIO $ finally (hPutStr to s) (hClose to)
- c <- hGetContents from
- return (p, c)
+ c <- hGetContentsStrict from
+ forceSuccess p
+ return c
{- Reads null terminated output of a git command (as enabled by the -z
- parameter), and splits it. -}