summaryrefslogtreecommitdiff
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
parent96fa6b89acdd77498140790553a42c81250816ed (diff)
bugfix: really run GitQueue against specified repo, not necessarily pwd
-rw-r--r--GitQueue.hs12
-rw-r--r--GitRepo.hs1
2 files changed, 7 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
diff --git a/GitRepo.hs b/GitRepo.hs
index b6670e2eb..9ecd3923a 100644
--- a/GitRepo.hs
+++ b/GitRepo.hs
@@ -25,6 +25,7 @@ module GitRepo (
configMap,
configRead,
configTrue,
+ gitCommandLine,
run,
pipeRead,
hPipeRead,