Skip to content
Permalink
Browse files

Merge branch 'file-url-to-unc-path'

This topic branch teaches Git to accept UNC paths of the form
file://host/share/repository.git.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
dscho committed Aug 16, 2017
2 parents eead5ec + a352941 commit 88a3d7f051dba2e389de14b84f4efefd9020db29
Showing with 15 additions and 2 deletions.
  1. +4 −0 connect.c
  2. +11 −2 t/t5500-fetch-pack.sh
@@ -652,6 +652,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
@@ -647,13 +647,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

0 comments on commit 88a3d7f

Please sign in to comment.
You can’t perform that action at this time.