diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-29 14:07:26 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-29 14:07:26 -0400 |
commit | d92f186fc4bc34e0999a6e47f15e54717e0ab206 (patch) | |
tree | 44e88f8716937d65d4ec70f425f2b0ed986872d9 /GitRepo.hs | |
parent | fa04c36fbe6bd9e936a74230bc8e887a90250bfd (diff) |
convert safeSystem to boolSystem
to fix ctrl-c handling
Diffstat (limited to 'GitRepo.hs')
-rw-r--r-- | GitRepo.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/GitRepo.hs b/GitRepo.hs index fd69ec21a..b9980826c 100644 --- a/GitRepo.hs +++ b/GitRepo.hs @@ -35,6 +35,7 @@ module GitRepo ( notInRepo ) where +import Monad (when, unless) import Directory import System import System.Directory @@ -183,10 +184,11 @@ gitCommandLine repo@(Repo { location = Dir d} ) params = ["--git-dir="++d++"/"++(dir repo), "--work-tree="++d] ++ params gitCommandLine repo _ = assertLocal repo $ error "internal" -{- Runs git in the specified repo. -} +{- Runs git in the specified repo, throwing an error if it fails. -} run :: Repo -> [String] -> IO () run repo params = assertLocal repo $ do - safeSystem "git" (gitCommandLine repo params) + ok <- boolSystem "git" (gitCommandLine repo params) + unless (ok) $ error $ "git " ++ (show params) ++ " failed" {- Runs a git subcommand and returns its output. -} pipeRead :: Repo -> [String] -> IO String |