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 -} - Note that for URL repositories, this is relative to the urlHost -}
workTree :: Repo -> FilePath workTree :: Repo -> FilePath
workTree repo = workTree r@(UrlRepo { }) = urlPath r
if (not $ repoIsUrl repo) workTree (Repo { top = p }) = p
then top repo
else urlPath repo
{- Given a relative or absolute filename in a repository, calculates the {- 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. - 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 -> [String] -> [String]
gitCommandLine repo params = assertLocal repo $ gitCommandLine repo params = assertLocal repo $
-- force use of specified repo via --git-dir and --work-tree -- 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. -} {- Runs git in the specified repo. -}
run :: Repo -> [String] -> IO () run :: Repo -> [String] -> IO ()