diff options
Diffstat (limited to 'GitRepo.hs')
-rw-r--r-- | GitRepo.hs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/GitRepo.hs b/GitRepo.hs index 0bee2842a..9f4a38a5f 100644 --- a/GitRepo.hs +++ b/GitRepo.hs @@ -38,6 +38,8 @@ module GitRepo ( gitCommandLine, run, pipeRead, + pipeWrite, + pipeWriteRead, pipeNullSplit, attributes, remotes, @@ -348,7 +350,7 @@ run repo subcommand params = assertLocal repo $ boolSystem "git" (gitCommandLine repo ((Param subcommand):params)) >>! error $ "git " ++ show params ++ " failed" -{- Runs a git subcommand and returns it output, lazily. +{- Runs a git subcommand and returns its output, lazily. - - Note that this leaves the git process running, and so zombies will - result unless reap is called. @@ -358,6 +360,18 @@ pipeRead repo params = assertLocal repo $ do (_, s) <- pipeFrom "git" $ toCommand $ gitCommandLine repo params return s +{- Runs a git subcommand, feeding it input. + - You should call either getProcessStatus or forceSuccess on the PipeHandle. -} +pipeWrite :: Repo -> [CommandParam] -> String -> IO PipeHandle +pipeWrite repo params s = assertLocal repo $ + pipeTo "git" (toCommand $ gitCommandLine repo params) s + +{- Runs a git subcommand, feeding it input, and returning its output. + - You should call either getProcessStatus or forceSuccess on the PipeHandle. -} +pipeWriteRead :: Repo -> [CommandParam] -> String -> IO (PipeHandle, String) +pipeWriteRead repo params s = assertLocal repo $ + pipeBoth "git" (toCommand $ gitCommandLine repo params) s + {- Reaps any zombie git processes. -} reap :: IO () reap = do |