git fetch: support host:/~repo
commit6a59974869c0a6e9399101bc02223b4c00a8aff2
authorTorsten Bögershausen <tboegi@web.de>
Thu, 28 Nov 2013 19:49:38 +0000 (28 20:49 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Dec 2013 22:54:47 +0000 (9 14:54 -0800)
tree8d3a9ce35fe91b08ff128079bf9fb92147c5d014
parent854aeb7beb85a7a3f05fc11daea7c8d2fed3a22c
git fetch: support host:/~repo

The documentation (in urls.txt) says that

    "ssh://host:/~repo",
    "host:/~repo" or
    "host:~repo"

specify the repository "repo" in the home directory at "host".

This has not been working for "host:/~repo".

Before commit 356bec "Support [address] in URLs", the comparison
"url != hostname" could be used to determine if the URL had a scheme
or not: "ssh://host/host" != "host".

However, after 356bec "[::1]" was converted into "::1", yielding
url != hostname as well.  To fix this regression, don't use
"if (url != hostname)", but look at the separator instead.

Rename the variable "c" into "separator" to make it easier to read.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c
t/t5500-fetch-pack.sh
t/t5601-clone.sh