3 test_description
='various Windows-only path tests'
6 if test_have_prereq CYGWIN
8 alias winpwd
='cygpath -aw .'
9 elif test_have_prereq MINGW
13 skip_all
='skipping Windows-only path tests'
20 # Use administrative share e.g. \\localhost\C$\git-sdk-64\usr\src\git
21 # (we use forward slashes here because MSYS2 and Git accept them, and
22 # they are easier on the eyes)
23 UNCPATH
="//localhost/${UNCPATH%%:*}\$/${UNCPATH#?:}"
24 test -d "$UNCPATH" ||
{
25 skip_all
='could not access administrative share; skipping'
30 skip_all
='skipping UNC path tests, cannot determine current path as UNC'
35 test_expect_success setup
'
39 test_expect_success clone
'
40 git clone "file://$UNCPATH" clone
43 test_expect_success
'clone with backslashed path' '
44 BACKSLASHED="$(echo "$UNCPATH" | tr / \\\\)" &&
45 git clone "$BACKSLASHED" backslashed
48 test_expect_success push
'
51 git checkout -b to-push &&
52 test_commit to-push &&
55 rev="$(git -C clone rev-parse --verify refs/heads/to-push)" &&
56 test "$rev" = "$(git rev-parse --verify refs/heads/to-push)"
59 test_expect_success MINGW
'remote nick cannot contain backslashes' '
60 BACKSLASHED="$(winpwd | tr / \\\\)" &&
61 git ls-remote "$BACKSLASHED" >out 2>err &&
62 test_i18ngrep ! "unable to access" err