This commit is contained in:
Joey Hess 2010-10-28 12:52:40 -04:00
parent 045b051ec1
commit 7109e20e5d

View file

@ -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 ()