clone: tighten "local paths with colons" check a bit
[gitweb.git] / connect.c
index 715a309d2152b5d8ba5624b38657a714adaf67b5..3c6300a21b9b70d2db4adc898be86ab06eb17e6c 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -550,7 +550,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 */