summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9b15770)
Allow IPv6address/IPvFuture enclosed by [] in URLs, like:
git push '[3ffe:ffff:...:1]:GIT/git'
or
git push 'ssh://[3ffe:ffff:...:1]/GIT/git'
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
{
char command[1024];
char *host, *path = url;
{
char command[1024];
char *host, *path = url;
int pipefd[2][2];
pid_t pid;
enum protocol protocol = PROTO_LOCAL;
int pipefd[2][2];
pid_t pid;
enum protocol protocol = PROTO_LOCAL;
*host = '\0';
protocol = get_protocol(url);
host += 3;
*host = '\0';
protocol = get_protocol(url);
host += 3;
- path = strchr(host, '/');
- }
- else {
- if ((colon = strchr(host, ':'))) {
+ c = ':';
+ }
+
+ if (host[0] == '[') {
+ end = strchr(host + 1, ']');
+ if (end) {
+ *end = 0;
+ end++;
+ host++;
+ } else
+ end = host;
+ } else
+ end = host;
+
+ path = strchr(end, c);
+ if (c == ':') {
+ if (path) {
- *colon = '\0';
- path = colon + 1;
- }
+ *path++ = '\0';
+ } else
+ path = host;