diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:52:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:52:22 -0700 |
commit | 41aaccdcf9170e744e423f2b1f889ada6604ae38 (patch) | |
tree | b785562c2face9c4b2523779525d186d0cbe368c /connect.c | |
parent | dbbc93b221c6ee9cb2d417a43078b0d2a986fd33 (diff) | |
parent | 60003340cda05f5ecd79ee8522b21eda038b994b (diff) | |
download | git-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |