Allow use of []-wrapped addresses in git://
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>
This commit is contained in:
parent
e8dbd76d57
commit
9aa5053d9f
@ -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) {
|
||||
if (protocol != PROTO_GIT) {
|
||||
*end = 0;
|
||||
end++;
|
||||
host++;
|
||||
}
|
||||
end++;
|
||||
} else
|
||||
end = host;
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user