Skip to content

Commit

Permalink
mingw: do not bother to test funny file names
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jan 28, 2016
1 parent c6c58c6 commit 5c01635
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions t/t3300-funny-names.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tree, index, and tree objects.

HT=' '

test_have_prereq MINGW ||
echo 2>/dev/null > "Name with an${HT}HT"
if ! test -f "Name with an${HT}HT"
then
Expand Down
2 changes: 1 addition & 1 deletion t/t3600-rm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test_expect_success \
git add -- foo bar baz 'space embedded' -q &&
git commit -m 'add normal files'"

if touch -- 'tab embedded' 'newline
if test_have_prereq !MINGW && touch -- 'tab embedded' 'newline
embedded' 2>/dev/null
then
test_set_prereq FUNNYNAMES
Expand Down
2 changes: 1 addition & 1 deletion t/t3703-add-magic-pathspec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cat >expected <<EOF
add 'sub/foo'
EOF

if mkdir ":" 2>/dev/null
if test_have_prereq !MINGW && mkdir ":" 2>/dev/null
then
test_set_prereq COLON_DIR
fi
Expand Down
1 change: 1 addition & 0 deletions t/t3902-quoted.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ GN='純'
HT=' '
DQ='"'

test_have_prereq MINGW ||
echo foo 2>/dev/null > "Name and an${HT}HT"
if ! test -f "Name and an${HT}HT"
then
Expand Down
1 change: 1 addition & 0 deletions t/t4016-diff-quote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ P1='pathname with HT'
P2='pathname with SP'
P3='pathname
with LF'
test_have_prereq !MINGW &&
echo 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1" || {
skip_all='Your filesystem does not allow tabs in filenames'
test_done
Expand Down
3 changes: 2 additions & 1 deletion t/t4135-apply-weird-filenames.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ test_expect_success 'setup' '
test_when_finished "rm -f \"tab embedded.txt\"" &&
test_when_finished "rm -f '\''\"quoteembedded\".txt'\''" &&
if touch -- "tab embedded.txt" '\''"quoteembedded".txt'\''
if test_have_prereq !MINGW &&
touch -- "tab embedded.txt" '\''"quoteembedded".txt'\''
then
test_set_prereq FUNNYNAMES
fi
Expand Down
2 changes: 1 addition & 1 deletion t/t9200-git-cvsexportcommit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/å/ä/ö" &&
then

# This test contains UTF-8 characters
test_expect_success \
test_expect_success !MINGW \
'File with non-ascii file name' \
'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/å/ä/ö &&
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 &&
Expand Down
2 changes: 1 addition & 1 deletion t/t9903-bash-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ repo_with_newline='repo
with
newline'

if mkdir "$repo_with_newline" 2>/dev/null
if test_have_prereq !MINGW && mkdir "$repo_with_newline" 2>/dev/null
then
test_set_prereq FUNNYNAMES
else
Expand Down

0 comments on commit 5c01635

Please sign in to comment.