summaryrefslogtreecommitdiff
path: root/GitRepo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-28 12:52:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-28 12:52:40 -0400
commit7109e20e5d2026c25a42a2784c1e3a430a67d3cf (patch)
treeb2ee35348142035b6e7bd40db784bbb0f1478348 /GitRepo.hs
parent045b051ec10023afc2e62895032527d5b5130495 (diff)
tweak
Diffstat (limited to 'GitRepo.hs')
-rw-r--r--GitRepo.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/GitRepo.hs b/GitRepo.hs
index d0fac96c1..4bad8a50d 100644
--- a/GitRepo.hs
+++ b/GitRepo.hs
@@ -150,10 +150,8 @@ dir repo = if (bare repo) then "" else ".git"
-
- Note that for URL repositories, this is relative to the urlHost -}
workTree :: Repo -> FilePath
-workTree repo =
- if (not $ repoIsUrl repo)
- then top repo
- else urlPath repo
+workTree r@(UrlRepo { }) = urlPath r
+workTree (Repo { top = p }) = p
{- Given a relative or absolute filename in a repository, calculates the
- name to use to refer to the file relative to a git repository's top.
@@ -186,7 +184,8 @@ urlPath repo = assertUrl repo $
gitCommandLine :: Repo -> [String] -> [String]
gitCommandLine repo params = assertLocal repo $
-- force use of specified repo via --git-dir and --work-tree
- ["--git-dir="++(top repo)++"/"++(dir repo), "--work-tree="++(top repo)] ++ params
+ ["--git-dir="++(top repo)++"/"++(dir repo),
+ "--work-tree="++(top repo)] ++ params
{- Runs git in the specified repo. -}
run :: Repo -> [String] -> IO ()