aboutsummaryrefslogtreecommitdiff
path: root/Git/CurrentRepo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-16 16:23:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-16 16:25:45 -0400
commit23e5fd63948b9aa6132ea26b755eb38818d59261 (patch)
tree6909ccf534a8a191a5b86c444fb58a4357c94374 /Git/CurrentRepo.hs
parent4f4aa0bdfd524682facb8245cf840048006bc59b (diff)
ensure that gitdir is absolute
calcGitLink turns out to need it to be absolute, and it normally is, but not if it's read from a .git file in a submodule, or perhaps from GIT_DIR. I should look into dropping this invariant.
Diffstat (limited to 'Git/CurrentRepo.hs')
-rw-r--r--Git/CurrentRepo.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Git/CurrentRepo.hs b/Git/CurrentRepo.hs
index f82241ae2..908cc389e 100644
--- a/Git/CurrentRepo.hs
+++ b/Git/CurrentRepo.hs
@@ -51,8 +51,11 @@ get = do
configure (Just d) r = do
r' <- Git.Config.read r
-- Let GIT_DIR override the default gitdir.
- return $ changelocation r' $
- Local { gitdir = d, worktree = worktree (location r') }
+ absd <- absPath d
+ return $ changelocation r' $ Local
+ { gitdir = absd
+ , worktree = worktree (location r')
+ }
addworktree w r = changelocation r $
Local { gitdir = gitdir (location r), worktree = w }
changelocation r l = r { location = l }