diff options
Diffstat (limited to 'Git/Command.hs')
-rw-r--r-- | Git/Command.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Git/Command.hs b/Git/Command.hs index 2d68540e6..6fe75f1d4 100644 --- a/Git/Command.hs +++ b/Git/Command.hs @@ -5,6 +5,8 @@ - Licensed under the GNU GPL version 3 or higher. -} +{-# LANGUAGE CPP #-} + module Git.Command where import System.Process (std_out, env) @@ -18,10 +20,16 @@ import qualified Utility.CoProcess as CoProcess gitCommandLine :: [CommandParam] -> Repo -> [CommandParam] gitCommandLine params Repo { location = l@(Local _ _ ) } = setdir : settree ++ params where - setdir = Param $ "--git-dir=" ++ gitdir l + setdir = Param $ "--git-dir=" ++ gitpath (gitdir l) settree = case worktree l of Nothing -> [] - Just t -> [Param $ "--work-tree=" ++ t] + Just t -> [Param $ "--work-tree=" ++ gitpath t] +#ifdef mingw32_HOST_OS + -- despite running on windows, msysgit wants a unix-formatted path + gitpath = dropDrive . toInternalGitPath +#else + gitpath = id +#endif gitCommandLine _ repo = assertLocal repo $ error "internal" {- Runs git in the specified repo. -} |