Skip to content

Commit 6f28b96

Browse files
committed
mingw: do not bother to test funny file names
MSYS2 actually allows to create files or directories whose names contain tabs, newlines or colors, even if plain Win32 API cannot access them. As we are using an MSYS2 bash to run the tests, such files or directories are created successfully, but Git itself has no chance to work with them because it is a regular Windows program, hence limited by the Win32 API. With this change, on Windows otherwise failing tests in t3300-funny-names.sh, t3600-rm.sh, t3703-add-magic-pathspec.sh, t3902-quoted.sh, t4016-diff-quote.sh, t4135-apply-weird-filenames.sh, t9200-git-cvsexportcommit.sh, and t9903-bash-prompt.sh are skipped. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 5d0634c commit 6f28b96

8 files changed

+9
-5
lines changed

t/t3300-funny-names.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tree, index, and tree objects.
1313

1414
HT=' '
1515

16+
test_have_prereq MINGW ||
1617
echo 2>/dev/null > "Name with an${HT}HT"
1718
if ! test -f "Name with an${HT}HT"
1819
then

t/t3600-rm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test_expect_success \
1414
git add -- foo bar baz 'space embedded' -q &&
1515
git commit -m 'add normal files'"
1616

17-
if touch -- 'tab embedded' 'newline
17+
if test_have_prereq !MINGW && touch -- 'tab embedded' 'newline
1818
embedded' 2>/dev/null
1919
then
2020
test_set_prereq FUNNYNAMES

t/t3703-add-magic-pathspec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ cat >expected <<EOF
3838
add 'sub/foo'
3939
EOF
4040

41-
if mkdir ":" 2>/dev/null
41+
if test_have_prereq !MINGW && mkdir ":" 2>/dev/null
4242
then
4343
test_set_prereq COLON_DIR
4444
fi

t/t3902-quoted.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ GN='純'
1212
HT=' '
1313
DQ='"'
1414

15+
test_have_prereq MINGW ||
1516
echo foo 2>/dev/null > "Name and an${HT}HT"
1617
if ! test -f "Name and an${HT}HT"
1718
then

t/t4016-diff-quote.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ P1='pathname with HT'
1313
P2='pathname with SP'
1414
P3='pathname
1515
with LF'
16+
test_have_prereq !MINGW &&
1617
echo 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1" || {
1718
skip_all='Your filesystem does not allow tabs in filenames'
1819
test_done

t/t4135-apply-weird-filenames.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ test_expect_success 'setup' '
1919
2020
test_when_finished "rm -f \"tab embedded.txt\"" &&
2121
test_when_finished "rm -f '\''\"quoteembedded\".txt'\''" &&
22-
if touch -- "tab embedded.txt" '\''"quoteembedded".txt'\''
22+
if test_have_prereq !MINGW &&
23+
touch -- "tab embedded.txt" '\''"quoteembedded".txt'\''
2324
then
2425
test_set_prereq FUNNYNAMES
2526
fi

t/t9200-git-cvsexportcommit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ if p="Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" &&
197197
then
198198

199199
# This test contains UTF-8 characters
200-
test_expect_success \
200+
test_expect_success !MINGW \
201201
'File with non-ascii file name' \
202202
'mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
203203
echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&

t/t9903-bash-prompt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ repo_with_newline='repo
6767
with
6868
newline'
6969

70-
if mkdir "$repo_with_newline" 2>/dev/null
70+
if test_have_prereq !MINGW && mkdir "$repo_with_newline" 2>/dev/null
7171
then
7272
test_set_prereq FUNNYNAMES
7373
else

0 commit comments

Comments
 (0)