From: Eric Sunshine Date: Tue, 07 Apr 2015 17:57:50 GMT Subject: Re: [PATCH/RFC] connect.c: Ignore extra colon after hostname Message-ID: In-Reply-To: <55238C42.7020402@web.de> On Tue, Apr 7, 2015 at 3:50 AM, Torsten Bögershausen wrote: > Ignore an extra ':' at the end of the hostname in URL's like > "ssh://example.com:/path/to/repo" > > The colon is ment to separate a port number from the hostname. s/ment/meant/ More below. > If the port is empty, the colon should be ignored, see RFC 3986. > > It had been working for URLs with ssh:// scheme, but was unintentionally > broken in 86ceb3, "allow ssh://user@[2001:db8::1]/repo.git" > > Reported-by: Reid Woodbury Jr. > Signed-off-by: Torsten Bögershausen > --- > diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh > index 02b40b1..1f67bdd 100755 > --- a/t/t5601-clone.sh > +++ b/t/t5601-clone.sh > @@ -387,14 +387,18 @@ do > done > > #with ssh:// scheme > -test_expect_success 'clone ssh://host.xz/home/user/repo' ' > - test_clone_url "ssh://host.xz/home/user/repo" host.xz "/home/user/repo" > -' > - > -# from home directory > -test_expect_success 'clone ssh://host.xz/~repo' ' > - test_clone_url "ssh://host.xz/~repo" host.xz "~repo" > +#ignore trailing colon > +for tcol in "" : > +do > + test_expect_success "clone ssh://host.xz$tcol/home/user/repo" ' > + test_clone_url "ssh://host.xz$tcol/home/user/repo" host.xz /home/user/repo > + ' > + # from home directory > + test_expect_success "clone ssh://host.xz$tcol/~repo" ' > + test_clone_url "ssh://host.xz$tcol/~repo" host.xz "~repo" > ' > +done > +test_done Unwanted test_done crept in? > # with port number > test_expect_success 'clone ssh://host.xz:22/home/user/repo' '