aboutsummaryrefslogtreecommitdiff
path: root/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-08-19 12:59:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-08-19 12:59:21 -0400
commite97fede8cd86d0eb804ced6d2877f617ba15b1a6 (patch)
treede28895e0a282bcc460c9da8636996272e0df7ec /Git.hs
parent7cedd28ab00d93b4a8d70810511a7c28cae65fd1 (diff)
make gitDir absolute
Diffstat (limited to 'Git.hs')
-rw-r--r--Git.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Git.hs b/Git.hs
index b226bce0f..168fe4154 100644
--- a/Git.hs
+++ b/Git.hs
@@ -247,11 +247,11 @@ attributes repo
| configBare repo = workTree repo ++ "/info/.gitattributes"
| otherwise = workTree repo ++ "/.gitattributes"
-{- Path to a repository's .git directory, relative to its workTree. -}
+{- Path to a repository's .git directory. -}
gitDir :: Repo -> String
gitDir repo
- | configBare repo = ""
- | otherwise = ".git"
+ | configBare repo = workTree repo
+ | otherwise = workTree repo </> ".git"
{- Path to a repository's --work-tree, that is, its top.
-
@@ -345,10 +345,10 @@ urlAuthPart _ repo = assertUrl repo $ error "internal"
{- Constructs a git command line operating on the specified repo. -}
gitCommandLine :: Repo -> [CommandParam] -> [CommandParam]
-gitCommandLine repo@(Repo { location = Dir d} ) params =
+gitCommandLine repo@(Repo { location = Dir _ } ) params =
-- force use of specified repo via --git-dir and --work-tree
- [ Param ("--git-dir=" ++ d ++ "/" ++ gitDir repo)
- , Param ("--work-tree=" ++ d)
+ [ Param ("--git-dir=" ++ gitDir repo)
+ , Param ("--work-tree=" ++ workTree repo)
] ++ params
gitCommandLine repo _ = assertLocal repo $ error "internal"