aboutsummaryrefslogtreecommitdiff
path: root/Git/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-22 17:11:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-22 17:11:41 -0400
commit9042ae3f4a12e2af802557f571bb793ab94b40d3 (patch)
tree7dd0b7b938a08f8bad44b13ec91c53e07c66c426 /Git/Command.hs
parenteb411b9c27437a57fede7d787d82a80920c2962e (diff)
assistant: Run the periodic git gc in batch mode.
Diffstat (limited to 'Git/Command.hs')
-rw-r--r--Git/Command.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Git/Command.hs b/Git/Command.hs
index 4c338ba25..90abc7e4f 100644
--- a/Git/Command.hs
+++ b/Git/Command.hs
@@ -18,6 +18,7 @@ import qualified Utility.CoProcess as CoProcess
#ifdef mingw32_HOST_OS
import Git.FilePath
#endif
+import Utility.Batch
{- Constructs a git command line operating on the specified repo. -}
gitCommandLine :: [CommandParam] -> Repo -> [CommandParam]
@@ -41,9 +42,13 @@ gitCommandLine _ repo = assertLocal repo $ error "internal"
{- Runs git in the specified repo. -}
runBool :: [CommandParam] -> Repo -> IO Bool
runBool params repo = assertLocal repo $
- boolSystemEnv "git"
- (gitCommandLine params repo)
- (gitEnv repo)
+ boolSystemEnv "git" (gitCommandLine params repo) (gitEnv repo)
+
+{- Runs git in batch mode. -}
+runBatch :: BatchCommandMaker -> [CommandParam] -> Repo -> IO Bool
+runBatch batchmaker params repo = assertLocal repo $ do
+ let (cmd, params') = batchmaker ("git", gitCommandLine params repo)
+ boolSystemEnv cmd params' (gitEnv repo)
{- Runs git in the specified repo, throwing an error if it fails. -}
run :: [CommandParam] -> Repo -> IO ()