summaryrefslogtreecommitdiff
path: root/Git/Command.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-11-11 15:01:13 -0400
committerJoey Hess <joeyh@joeyh.name>2016-11-11 15:01:13 -0400
commit962e279e17c1f3cf3be49ffdfb5e7310711a220c (patch)
treed9953d9e57dea51c24ccaf4d7e64731010546f4f /Git/Command.hs
parent7d7f93302c72cbe1a16598b0c90a49c10aaf3669 (diff)
downloadgit-repair-962e279e17c1f3cf3be49ffdfb5e7310711a220c.tar.gz
merge from git-annex
Diffstat (limited to 'Git/Command.hs')
-rw-r--r--Git/Command.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Git/Command.hs b/Git/Command.hs
index 02e3e5a..2060563 100644
--- a/Git/Command.hs
+++ b/Git/Command.hs
@@ -17,9 +17,11 @@ import qualified Utility.CoProcess as CoProcess
{- Constructs a git command line operating on the specified repo. -}
gitCommandLine :: [CommandParam] -> Repo -> [CommandParam]
gitCommandLine params r@(Repo { location = l@(Local { } ) }) =
- setdir : settree ++ gitGlobalOpts r ++ params
+ setdir ++ settree ++ gitGlobalOpts r ++ params
where
- setdir = Param $ "--git-dir=" ++ gitdir l
+ setdir
+ | gitEnvOverridesGitDir r = []
+ | otherwise = [Param $ "--git-dir=" ++ gitdir l]
settree = case worktree l of
Nothing -> []
Just t -> [Param $ "--work-tree=" ++ t]