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
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user