From: Johannes Sixt Date: Fri, 30 Nov 2007 21:51:10 +0000 (+0100) Subject: Windows: Disambiguate DOS style paths from SSH URLs. X-Git-Tag: v1.6.0-rc0~159^2~17 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=be501813d25bedc1a441940f349fb91bd9fa4ef6;p=git.git Windows: Disambiguate DOS style paths from SSH URLs. If on Windows a path is specified as C:/path, then this is also a valid SSH URL. To disambiguate between the two interpretations we take an URL that looks like a path with a drive letter as a local URL. Signed-off-by: Johannes Sixt --- diff --git a/connect.c b/connect.c index e92af2973..574f42fa4 100644 --- a/connect.c +++ b/connect.c @@ -529,7 +529,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig, end = host; path = strchr(end, c); - if (path) { + if (path && !has_dos_drive_prefix(end)) { if (c == ':') { protocol = PROTO_SSH; *path++ = '\0'; diff --git a/transport.c b/transport.c index 3ff851935..4145eed97 100644 --- a/transport.c +++ b/transport.c @@ -709,7 +709,8 @@ static int is_local(const char *url) { const char *colon = strchr(url, ':'); const char *slash = strchr(url, '/'); - return !colon || (slash && slash < colon); + return !colon || (slash && slash < colon) || + has_dos_drive_prefix(url); } static int is_file(const char *url)