From ebb8d2c90fb0840a0803935804e37e2205505f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Sat, 24 Aug 2019 15:07:59 -0700 Subject: mingw: support UNC in git clone file://server/share/repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- connect.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'connect.c') diff --git a/connect.c b/connect.c index 2778481264..da7daa2b68 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 -- cgit v1.2.3