summaryrefslogtreecommitdiff
path: root/GitQueue.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-31 15:25:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-31 15:25:55 -0400
commit435ec21d58f9c7ddb622f290648b31da2c9a8f1e (patch)
treedbada864f7695acaa7ea5e09a657f4913c3761e5 /GitQueue.hs
parent96fa6b89acdd77498140790553a42c81250816ed (diff)
bugfix: really run GitQueue against specified repo, not necessarily pwd
Diffstat (limited to 'GitQueue.hs')
-rw-r--r--GitQueue.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/GitQueue.hs b/GitQueue.hs
index 09b8037e6..632d1d391 100644
--- a/GitQueue.hs
+++ b/GitQueue.hs
@@ -23,8 +23,8 @@ import qualified GitRepo as Git
{- An action to perform in a git repository. The file to act on
- is not included, and must be able to be appended after the params. -}
data Action = Action {
- subcommand :: String,
- params :: [String]
+ getSubcommand :: String,
+ getParams :: [String]
} deriving (Show, Eq, Ord)
{- A queue of actions to perform (in any order) on a git repository,
@@ -45,7 +45,7 @@ add queue subcommand params file = M.insertWith (++) action [file] queue
{- Runs a queue on a git repository. -}
run :: Git.Repo -> Queue -> IO ()
run repo queue = do
- mapM (\(k, v) -> runAction repo k v) $ M.toList queue
+ _ <- mapM (\(k, v) -> runAction repo k v) $ M.toList queue
return ()
{- Runs an Action on a list of files in a git repository.
@@ -55,7 +55,7 @@ runAction :: Git.Repo -> Action -> [FilePath] -> IO ()
runAction repo action files = do
unless (null files) runxargs
where
- runxargs = pOpen WriteToPipe "xargs"
- (["-0", "git", subcommand action] ++ (params action))
- feedxargs
+ runxargs = pOpen WriteToPipe "xargs" ("-0":gitcmd) feedxargs
+ gitcmd = ["git"] ++ Git.gitCommandLine repo
+ ((getSubcommand action):(getParams action))
feedxargs h = hPutStr h $ join "\0" files