Skip to content

Commit f21d60b

Browse files
me-andgitster
authored andcommitted
t5580: add Cygwin support
t5580 tests that specifying Windows UNC paths works with Git. Cygwin supports UNC paths, albeit only using forward slashes, not backslashes, so run the compatible tests on Cygwin as well as MinGW. The only complication is Cygwin's `pwd`, which returns a *nix-style path, and that's not suitable for calculating the UNC path to the current directory. Instead use Cygwin's `cygpath` utility to get the Windows-style path. Signed-off-by: Adam Dinwoodie <[email protected]> Reviewed-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fc849d8 commit f21d60b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

t/t5580-clone-push-unc.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
test_description='various Windows-only path tests'
44
. ./test-lib.sh
55

6-
if ! test_have_prereq MINGW; then
6+
if test_have_prereq CYGWIN
7+
then
8+
alias winpwd='cygpath -aw .'
9+
elif test_have_prereq MINGW
10+
then
11+
alias winpwd=pwd
12+
else
713
skip_all='skipping Windows-only path tests'
814
test_done
915
fi
1016

11-
UNCPATH="$(pwd)"
17+
UNCPATH="$(winpwd)"
1218
case "$UNCPATH" in
1319
[A-Z]:*)
1420
# Use administrative share e.g. \\localhost\C$\git-sdk-64\usr\src\git
@@ -45,8 +51,8 @@ test_expect_success push '
4551
test "$rev" = "$(git rev-parse --verify refs/heads/to-push)"
4652
'
4753

48-
test_expect_success 'remote nick cannot contain backslashes' '
49-
BACKSLASHED="$(pwd | tr / \\\\)" &&
54+
test_expect_success MINGW 'remote nick cannot contain backslashes' '
55+
BACKSLASHED="$(winpwd | tr / \\\\)" &&
5056
git ls-remote "$BACKSLASHED" >out 2>err &&
5157
test_i18ngrep ! "unable to access" err
5258
'

0 commit comments

Comments
 (0)