summaryrefslogtreecommitdiff
path: root/Command/Map.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-10-12 14:11:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-10-12 14:11:29 -0400
commit1c49e101b7454fb1fd83f468f28bfacb6c7194cf (patch)
tree7e2a252e62e5fdf195f775a828d356a6b72b9f31 /Command/Map.hs
parent8f916e27f5bc4f665bb85ea231f09afbf0f101bd (diff)
map: Handle .git prefixed remote repos. Closes: #614759
Diffstat (limited to 'Command/Map.hs')
-rw-r--r--Command/Map.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Command/Map.hs b/Command/Map.hs
index b1d28113b..91862ae55 100644
--- a/Command/Map.hs
+++ b/Command/Map.hs
@@ -206,14 +206,15 @@ tryScan r
sshparams <- Ssh.toRepo r gc [Param sshcmd]
liftIO $ pipedconfig "ssh" sshparams
where
- sshcmd = cddir ++ " && " ++
- "git config --null --list"
+ sshcmd = "sh -c " ++ shellEscape
+ (cddir ++ " && " ++ "git config --null --list")
dir = Git.repoPath r
cddir
| "/~" `isPrefixOf` dir =
let (userhome, reldir) = span (/= '/') (drop 1 dir)
- in "cd " ++ userhome ++ " && cd " ++ shellEscape (drop 1 reldir)
- | otherwise = "cd " ++ shellEscape dir
+ in "cd " ++ userhome ++ " && " ++ cdto (drop 1 reldir)
+ | 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,
-- only fall back to git-annex-shell configlist if that