diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-09-30 13:19:27 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-09-30 13:19:27 +0900 |
| commit | aadac067aa34a148477c9db98058941be3e4465c (patch) | |
| tree | b16dfdcca18ea00a973563458e55514c9ae5cee3 | |
| parent | Merge branch 'js/gitdir-at-unc-root' (diff) | |
| parent | mingw: support UNC in git clone file://server/share/repo (diff) | |
| download | git-aadac067aa34a148477c9db98058941be3e4465c.tar.gz git-aadac067aa34a148477c9db98058941be3e4465c.zip | |
Merge branch 'tb/file-url-to-unc-path'
Windows update.
* tb/file-url-to-unc-path:
mingw: support UNC in git clone file://server/share/repo
| -rw-r--r-- | connect.c | 4 | ||||
| -rwxr-xr-x | t/t5500-fetch-pack.sh | 13 |
2 files changed, 15 insertions, 2 deletions
@@ -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 diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 8210f63d41..5115711562 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -708,13 +708,22 @@ do # file with scheme for p in file do - test_expect_success "fetch-pack --diag-url $p://$h/$r" ' + test_expect_success !MINGW "fetch-pack --diag-url $p://$h/$r" ' check_prot_path $p://$h/$r $p "/$r" ' + test_expect_success MINGW "fetch-pack --diag-url $p://$h/$r" ' + check_prot_path $p://$h/$r $p "//$h/$r" + ' + test_expect_success MINGW "fetch-pack --diag-url $p:///$r" ' + check_prot_path $p:///$r $p "/$r" + ' # No "/~" -> "~" conversion for file - test_expect_success "fetch-pack --diag-url $p://$h/~$r" ' + test_expect_success !MINGW "fetch-pack --diag-url $p://$h/~$r" ' check_prot_path $p://$h/~$r $p "/~$r" ' + test_expect_success MINGW "fetch-pack --diag-url $p://$h/~$r" ' + check_prot_path $p://$h/~$r $p "//$h/~$r" + ' done # file without scheme for h in nohost nohost:12 [::1] [::1]:23 [ [:aa |
