X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=connect.c;h=a37cf6af0428023d2d3ef01ab2e04fc462981af4;hb=4ac23f375f144d06d66d04a5e5323388d6f53251;hp=3a125621465a68a267d08f74d842238a078c51b2;hpb=d539de9f25920f099e4e56b0acbb4ebf246ff0f4;p=git.git diff --git a/connect.c b/connect.c index 3a1256214..a37cf6af0 100644 --- a/connect.c +++ b/connect.c @@ -502,12 +502,18 @@ struct child_process *git_connect(int fd[2], const char *url_orig, c = ':'; } + /* + * Don't do destructive transforms with git:// as that + * protocol code does '[]' unwrapping of its own. + */ if (host[0] == '[') { end = strchr(host + 1, ']'); if (end) { - *end = 0; + if (protocol != PROTO_GIT) { + *end = 0; + host++; + } end++; - host++; } else end = host; } else