summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2019-08-24 22:07:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-26 17:00:33 (GMT)
commitebb8d2c90fb0840a0803935804e37e2205505f23 (patch)
treec218d8e558cc7ea372a858d749241459a92dce1c /connect.c
parent745f6812895b31c02b29bdfe4ae8e5498f776c26 (diff)
downloadgit-ebb8d2c90fb0840a0803935804e37e2205505f23.zip
git-ebb8d2c90fb0840a0803935804e37e2205505f23.tar.gz
git-ebb8d2c90fb0840a0803935804e37e2205505f23.tar.bz2
mingw: support UNC in git clone file://server/share/repo
Extend the parser to accept file://server/share/repo in the way that Windows users expect it to be parsed who are used to referring to file shares by UNC paths of the form \\server\share\folder. [jes: tightened check to avoid handling file://C:/some/path as a UNC path.] This closes https://github.com/git-for-windows/git/issues/1264. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/connect.c b/connect.c
index 2778481..da7daa2 100644
--- a/connect.c
+++ b/connect.c
@@ -915,6 +915,10 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,
if (protocol == PROTO_LOCAL)
path = end;
+ else if (protocol == PROTO_FILE && *host != '/' &&
+ !has_dos_drive_prefix(host) &&
+ offset_1st_component(host - 2) > 1)
+ path = host - 2; /* include the leading "//" */
else if (protocol == PROTO_FILE && has_dos_drive_prefix(end))
path = end; /* "file://$(pwd)" may be "file://C:/projects/repo" */
else