summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-27 14:56:42 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-27 14:56:42 -0800
commit68186857a9bb0a71e9456155623e02d398a5b817 (patch)
treea8c9a2b0a6d27f15739cb357850d9f5fb72125f7 /connect.c
parenta0075d9e6ae211e8bde3eb40c8cdebb1772ee680 (diff)
parent9aa5053d9ffc7fade885b58a34175b4907b1a4f8 (diff)
downloadgit-68186857a9bb0a71e9456155623e02d398a5b817.tar.gz
Merge branch 'il/maint-colon-address'
* il/maint-colon-address: Allow use of []-wrapped addresses in git:// Support addresses with ':' in git-daemon
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/connect.c b/connect.c
index 3a12562146..20054e4d0f 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 '[]' 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