diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-13 00:58:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-13 00:58:59 -0400 |
commit | 67ae9d7fa109503e4b798e2b7703282b92ce3deb (patch) | |
tree | 375b45936f516bf05a7f858d3ba10d9d9f450878 /GitRepo.hs | |
parent | 14d7b2ac13318ba513bbab4f08b98434741f0e12 (diff) |
relative symlink to annexed file
Diffstat (limited to 'GitRepo.hs')
-rw-r--r-- | GitRepo.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/GitRepo.hs b/GitRepo.hs index fcaae1253..f0686ff20 100644 --- a/GitRepo.hs +++ b/GitRepo.hs @@ -98,14 +98,12 @@ gitAttributes repo = assertlocal repo $ do then (top repo) ++ "/info/.gitattributes" else (top repo) ++ "/.gitattributes" -{- Path to a repository's .git directory. - - (For a bare repository, that is the root of the repository.) - - TODO: support GIT_DIR -} +{- Path to a repository's .git directory, relative to its topdir. -} gitDir :: GitRepo -> String gitDir repo = assertlocal repo $ if (bare repo) - then top repo - else top repo ++ "/.git" + then "" + else ".git" {- Path to a repository's --work-tree. -} gitWorkTree :: GitRepo -> FilePath @@ -130,7 +128,7 @@ gitRelative repo file = drop (length absrepo) absfile gitCommandLine :: GitRepo -> [String] -> [String] gitCommandLine repo params = assertlocal repo $ -- force use of specified repo via --git-dir and --work-tree - ["--git-dir="++(gitDir repo), "--work-tree="++(top repo)] ++ params + ["--git-dir="++(top repo)++"/"++(gitDir repo), "--work-tree="++(top repo)] ++ params {- Runs git in the specified repo. -} gitRun :: GitRepo -> [String] -> IO () |