summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-02 15:52:22 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-02 15:52:22 -0700
commit41aaccdcf9170e744e423f2b1f889ada6604ae38 (patch)
treeb785562c2face9c4b2523779525d186d0cbe368c /connect.c
parentdbbc93b221c6ee9cb2d417a43078b0d2a986fd33 (diff)
parent60003340cda05f5ecd79ee8522b21eda038b994b (diff)
downloadgit-41aaccdcf9170e744e423f2b1f889ada6604ae38.tar.gz
Merge branch 'nd/clone-local-with-colon'
"git clone foo/bar:baz" cannot be a request to clone from a remote over git-over-ssh specified in the scp style. Detect this case and clone from a local repository at "foo/bar:baz". * nd/clone-local-with-colon: clone: allow cloning local paths with colons in them
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/connect.c b/connect.c
index f57efd06c1..a0783d4867 100644
--- a/connect.c
+++ b/connect.c
@@ -551,8 +551,11 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
path = strchr(end, c);
if (path && !has_dos_drive_prefix(end)) {
if (c == ':') {
- protocol = PROTO_SSH;
- *path++ = '\0';
+ if (path < strchrnul(host, '/')) {
+ protocol = PROTO_SSH;
+ *path++ = '\0';
+ } else /* '/' in the host part, assume local path */
+ path = end;
}
} else
path = end;