From: Mike Hommey Date: Fri, 27 May 2016 02:27:48 GMT Subject: [PATCH v8 1/9] connect: document why we sometimes call get_port after get_host_and_port Message-ID: <20160527022756.22904-2-mh@glandium.org> In-Reply-To: <20160527022756.22904-1-mh@glandium.org> Signed-off-by: Mike Hommey --- connect.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/connect.c b/connect.c index c53f3f1..6e520c3 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); -- 2.8.3