Merge branch 'nd/clone-local-with-colon'

* nd/clone-local-with-colon:
  clone: tighten "local paths with colons" check a bit
This commit is contained in:
Jonathan Nieder
2013-10-14 11:06:57 -07:00
2 changed files with 46 additions and 2 deletions

View File

@ -552,7 +552,7 @@ 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 == ':') {
if (path < strchrnul(host, '/')) {
if (host != url || path < strchrnul(host, '/')) {
protocol = PROTO_SSH;
*path++ = '\0';
} else /* '/' in the host part, assume local path */