git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] connect.c: Ignore extra colon after hostname

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 7, 2015, 17:57 UTC
Message-ID
<CAPig+cQZDPRa=2Oaur71OufeP2ECjOFK3JEwdRQNUYs49SySNg@mail.gmail.com>
In-Reply-To
<55238C42.7020402@web.de>
On Tue, Apr 7, 2015 at 3:50 AM, Torsten Bögershausen <tboegi@web.de> 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.
Show 35 quoted lines
> 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. <reidw@rawsound.com>
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
> ---
> 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' '
Previous: Torsten Bögershausen
Message 2 of 2 in “connect.c: Ignore extra colon after hostname”
  1. connect.c: Ignore extra colon after hostnameTorsten Bögershausen, Apr 7, 2015
  2. Eric SunshineApr 7, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.