]> git.ipfire.org Git - thirdparty/git.git/blobdiff - connect.c
Merge branch 'pm/am-in-body-header-doc-update'
[thirdparty/git.git] / connect.c
index 4050a797bfabdb4f63416682a6511fc1d76d4bdb..b6451ab5e8909017edc678b3021384f3920fbe75 100644 (file)
--- 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