diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-04 12:18:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-04 12:18:49 -0400 |
commit | 5a3f88cabe2fb61c22405ff98f55b0f17658f03d (patch) | |
tree | d6cebb2f6d53607786bdbb4d15eb4804dfd74d6c | |
parent | 3a88047aa22e10507c33081c35673d0bac6b6e18 (diff) |
reorg
avoid Git.Command needing Utility.Batch which needs async
For github-backup etc
-rw-r--r-- | Assistant/Threads/SanityChecker.hs | 3 | ||||
-rw-r--r-- | Git/Command.hs | 7 | ||||
-rw-r--r-- | Git/Command/Batch.hs | 19 |
3 files changed, 21 insertions, 8 deletions
diff --git a/Assistant/Threads/SanityChecker.hs b/Assistant/Threads/SanityChecker.hs index bc5be9c75..7e072afd5 100644 --- a/Assistant/Threads/SanityChecker.hs +++ b/Assistant/Threads/SanityChecker.hs @@ -24,6 +24,7 @@ import Assistant.Types.UrlRenderer import qualified Annex.Branch import qualified Git.LsFiles import qualified Git.Command +import qualified Git.Command.Batch import qualified Git.Config import Utility.ThreadScheduler import qualified Assistant.Threads.Watcher as Watcher @@ -167,7 +168,7 @@ dailyCheck urlrenderer = do - to have a lot of small objects and they should not be a - significant size. -} when (Git.Config.getMaybe "gc.auto" g == Just "0") $ - liftIO $ void $ Git.Command.runBatch batchmaker + liftIO $ void $ Git.Command.Batch.run batchmaker [ Param "-c", Param "gc.auto=670000" , Param "gc" , Param "--auto" diff --git a/Git/Command.hs b/Git/Command.hs index 39a3c6849..30d2dcbf9 100644 --- a/Git/Command.hs +++ b/Git/Command.hs @@ -13,7 +13,6 @@ import Common import Git import Git.Types import qualified Utility.CoProcess as CoProcess -import Utility.Batch {- Constructs a git command line operating on the specified repo. -} gitCommandLine :: [CommandParam] -> Repo -> [CommandParam] @@ -31,12 +30,6 @@ runBool :: [CommandParam] -> Repo -> IO Bool runBool params repo = assertLocal 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 () run params repo = assertLocal repo $ diff --git a/Git/Command/Batch.hs b/Git/Command/Batch.hs new file mode 100644 index 000000000..9cc176008 --- /dev/null +++ b/Git/Command/Batch.hs @@ -0,0 +1,19 @@ +{- running batch git commands + - + - Copyright 2010-2013 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Git.Command.Batch where + +import Common +import Git +import Git.Command +import Utility.Batch + +{- Runs git in batch mode. -} +run :: BatchCommandMaker -> [CommandParam] -> Repo -> IO Bool +run batchmaker params repo = assertLocal repo $ do + let (cmd, params') = batchmaker ("git", gitCommandLine params repo) + boolSystemEnv cmd params' (gitEnv repo) |