summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/BundledPrograms.hs3
-rw-r--r--Git/Queue.hs20
2 files changed, 17 insertions, 6 deletions
diff --git a/Build/BundledPrograms.hs b/Build/BundledPrograms.hs
index 7ce3900c1..7100af503 100644
--- a/Build/BundledPrograms.hs
+++ b/Build/BundledPrograms.hs
@@ -24,7 +24,10 @@ bundledPrograms = catMaybes
, Just "git"
#endif
, Just "cp"
+#ifndef mingw32_HOST_OS
+ -- using xargs on windows led to problems, so it's not used there
, Just "xargs"
+#endif
, Just "rsync"
, Just "ssh"
#ifndef mingw32_HOST_OS
diff --git a/Git/Queue.hs b/Git/Queue.hs
index b8e863658..9bb7f77d1 100644
--- a/Git/Queue.hs
+++ b/Git/Queue.hs
@@ -5,7 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP, BangPatterns #-}
module Git.Queue (
Queue,
@@ -26,7 +26,7 @@ import Common
import Git
import Git.Command
import qualified Git.UpdateIndex
-
+
{- Queable actions that can be performed in a git repository.
-}
data Action
@@ -147,13 +147,21 @@ runAction :: Repo -> Action -> IO ()
runAction repo (UpdateIndexAction streamers) =
-- list is stored in reverse order
Git.UpdateIndex.streamUpdateIndex repo $ reverse streamers
-runAction repo action@(CommandAction {}) =
+runAction repo action@(CommandAction {}) =
+#ifndef mingw32_HOST_OS
withHandle StdinHandle createProcessSuccess p $ \h -> do
fileEncoding h
hPutStr h $ intercalate "\0" $ toCommand $ getFiles action
hClose h
+#else
+ -- Using xargs on Windows is problimatic, so just run the command
+ -- once per file (not as efficient.)
+ if null (getFiles action)
+ then void $ boolSystem "git" gitparams
+ else forM_ (getFiles action) $ \f ->
+ void $ boolSystem "git" (gitparams ++ [f])
+#endif
where
- p = (proc "xargs" params) { env = gitEnv repo }
- params = "-0":"git":baseparams
- baseparams = toCommand $ gitCommandLine
+ p = (proc "xargs" $ "-0":"git":toCommand gitparams) { env = gitEnv repo }
+ gitparams = gitCommandLine
(Param (getSubcommand action):getParams action) repo