summaryrefslogtreecommitdiff
path: root/GitRepo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-22 16:02:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-22 16:02:07 -0400
commitae2be332d463bb2942c5951ffa4acf4d32d63ce2 (patch)
treeaa7b5392b4f5059c5dfa9e1e269d3248a48609fc /GitRepo.hs
parent2e5c8ca6bf016058f2aba4eaba5b89955e3e0e95 (diff)
add runBool
Diffstat (limited to 'GitRepo.hs')
-rw-r--r--GitRepo.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/GitRepo.hs b/GitRepo.hs
index 91ddf6dca..d1f122fba 100644
--- a/GitRepo.hs
+++ b/GitRepo.hs
@@ -37,6 +37,7 @@ module GitRepo (
configTrue,
gitCommandLine,
run,
+ runBool,
pipeRead,
pipeWrite,
pipeWriteRead,
@@ -350,10 +351,15 @@ gitCommandLine repo@(Repo { location = Dir d} ) params =
] ++ params
gitCommandLine repo _ = assertLocal repo $ error "internal"
+{- Runs git in the specified repo. -}
+runBool :: Repo -> String -> [CommandParam] -> IO Bool
+runBool repo subcommand params = assertLocal repo $
+ boolSystem "git" (gitCommandLine repo ((Param subcommand):params))
+
{- Runs git in the specified repo, throwing an error if it fails. -}
run :: Repo -> String -> [CommandParam] -> IO ()
run repo subcommand params = assertLocal repo $
- boolSystem "git" (gitCommandLine repo ((Param subcommand):params))
+ runBool repo subcommand params
>>! error $ "git " ++ show params ++ " failed"
{- Runs a git subcommand and returns its output, lazily.