From: Ilari Liusvaara Date: Tue, 26 Jan 2010 18:24:42 +0000 (+0200) Subject: Allow use of []-wrapped addresses in git:// X-Git-Tag: v1.7.0-rc1~24^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9aa5053d9ffc7fade885b58a34175b4907b1a4f8;p=git.git Allow use of []-wrapped addresses in git:// Allow using "[""]": and "[""]" notations in git:// host addresses. This is needed to be able to connect to addresses that contain ':' (e.g. numeric IPv6 addresses). Also send the host header []-wrapped so it can actually be parsed by remote end. Signed-off-by: Ilari Liusvaara Signed-off-by: Junio C Hamano --- diff --git a/connect.c b/connect.c index 7945e38ac..5145d1620 100644 --- a/connect.c +++ b/connect.c @@ -523,12 +523,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 '[]' dewrapping 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