aboutsummaryrefslogtreecommitdiff
path: root/Git/Construct.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/Construct.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/Construct.hs')
-rw-r--r--Git/Construct.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Git/Construct.hs b/Git/Construct.hs
index 3c1cfdbdf..3d39b0801 100644
--- a/Git/Construct.hs
+++ b/Git/Construct.hs
@@ -227,7 +227,8 @@ checkForRepo dir =
catchDefaultIO "" (readFile $ dir </> ".git")
return $ if gitdirprefix `isPrefixOf` c
then Just $ Local
- { gitdir = drop (length gitdirprefix) c
+ { gitdir = absPathFrom dir $
+ drop (length gitdirprefix) c
, worktree = Just dir
}
else Nothing