summaryrefslogtreecommitdiff
path: root/GitRepo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-17 03:10:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-17 03:13:11 -0400
commitc91929f6934fc4e94603d0fa004e824d5e2cfb65 (patch)
treee958f5b4dc1209afb90c786493164c351dea4b9a /GitRepo.hs
parent75a3f5027f74565d909fb940893636d081d9872a (diff)
add whenM and unlessM
Just more golfing.. I am pretty sure something in a library somewhere can do this, but I have been unable to find it.
Diffstat (limited to 'GitRepo.hs')
-rw-r--r--GitRepo.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/GitRepo.hs b/GitRepo.hs
index 87cceece4..d070bc89e 100644
--- a/GitRepo.hs
+++ b/GitRepo.hs
@@ -329,9 +329,9 @@ gitCommandLine repo _ = assertLocal repo $ error "internal"
{- Runs git in the specified repo, throwing an error if it fails. -}
run :: Repo -> String -> [CommandParam] -> IO ()
-run repo subcommand params = assertLocal repo $ do
- ok <- boolSystem "git" (gitCommandLine repo ((Param subcommand):params))
- unless ok $ error $ "git " ++ show params ++ " failed"
+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.
-