map: Handle .git prefixed remote repos. Closes: #614759

This commit is contained in:
Joey Hess 2014-10-12 14:11:29 -04:00
parent ac950c0de8
commit 9af06670b5
2 changed files with 6 additions and 4 deletions

View file

@ -206,14 +206,15 @@ tryScan r
sshparams <- Ssh.toRepo r gc [Param sshcmd] sshparams <- Ssh.toRepo r gc [Param sshcmd]
liftIO $ pipedconfig "ssh" sshparams liftIO $ pipedconfig "ssh" sshparams
where where
sshcmd = cddir ++ " && " ++ sshcmd = "sh -c " ++ shellEscape
"git config --null --list" (cddir ++ " && " ++ "git config --null --list")
dir = Git.repoPath r dir = Git.repoPath r
cddir cddir
| "/~" `isPrefixOf` dir = | "/~" `isPrefixOf` dir =
let (userhome, reldir) = span (/= '/') (drop 1 dir) let (userhome, reldir) = span (/= '/') (drop 1 dir)
in "cd " ++ userhome ++ " && cd " ++ shellEscape (drop 1 reldir) in "cd " ++ userhome ++ " && " ++ cdto (drop 1 reldir)
| otherwise = "cd " ++ shellEscape dir | otherwise = cdto dir
cdto dir = "if ! cd " ++ shellEscape dir ++ " 2>/dev/null; then cd " ++ shellEscape dir ++ ".git; fi"
-- First, try sshing and running git config manually, -- First, try sshing and running git config manually,
-- only fall back to git-annex-shell configlist if that -- only fall back to git-annex-shell configlist if that

1
debian/changelog vendored
View file

@ -3,6 +3,7 @@ git-annex (5.20140928) UNRELEASED; urgency=medium
* Adjust cabal file to support building w/o assistant on the hurd. * Adjust cabal file to support building w/o assistant on the hurd.
* Support building with yesod 1.4. * Support building with yesod 1.4.
* S3: Fix embedcreds=yes handling for the Internet Archive. * S3: Fix embedcreds=yes handling for the Internet Archive.
* map: Handle .git prefixed remote repos. Closes: #614759
-- Joey Hess <joeyh@debian.org> Mon, 29 Sep 2014 14:07:51 -0400 -- Joey Hess <joeyh@debian.org> Mon, 29 Sep 2014 14:07:51 -0400