summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e8dbd76)
raw | patch | inline | side by side (parent: e8dbd76)
author | Ilari Liusvaara <ilari.liusvaara@elisanet.fi> | |
Tue, 26 Jan 2010 18:24:42 +0000 (20:24 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 26 Jan 2010 18:52:52 +0000 (10:52 -0800) |
Allow using "["<host>"]":<port> and "["<host>"]" 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 <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c | patch | blob | history |
diff --git a/connect.c b/connect.c
index 7945e38ac1c99c09f7975ae99767bc9747ac3740..5145d1620c2f58cd6904b5957cbf2e1785f9de37 100644 (file)
--- a/connect.c
+++ b/connect.c
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