aboutsummaryrefslogtreecommitdiff
path: root/Git/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-04-08 14:24:00 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-04-08 14:24:00 -0400
commitfdfd56c647d685ad5618917341db0b7c97e1b63a (patch)
treea287e49f51af48f27a23711abb346134c218977d /Git/Command.hs
parent6f4b9f2df58684d4b8e2099be59283be97f1318e (diff)
avoid withWorkTreeRelated affecting annex symlink calculation
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 02e3e5a34..206056368 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]