summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2016-05-27 11:27:48 +0900
committerJunio C Hamano <gitster@pobox.com>2016-06-01 12:53:12 -0700
commite7c378e45ac6f59153db6c843ea2b8622015bee9 (patch)
treed7479a9600e1927adf7ffed36e644ebcbf883dda
parent3916adf9978b020f9a9b165f4c1c109046899560 (diff)
downloadgit-e7c378e45ac6f59153db6c843ea2b8622015bee9.tar.gz
connect: document why we sometimes call get_port after get_host_and_port
Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--connect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/connect.c b/connect.c
index c53f3f1c55..6e520c3b9c 100644
--- a/connect.c
+++ b/connect.c
@@ -742,6 +742,13 @@ struct child_process *git_connect(int fd[2], const char *url,
transport_check_allowed("ssh");
get_host_and_port(&ssh_host, &port);
+ /*
+ * get_host_and_port does not return a port in the
+ * [host:port]:path case. In that case, it is called
+ * with "[host:port]" and returns "host:port" and NULL.
+ * To support this undocumented legacy we still need
+ * to split the port.
+ */
if (!port)
port = get_port(ssh_host);