Skip to content

Commit cf7efa4

Browse files
ramsay-jonesgitster
authored andcommitted
t6137-*.sh: fix test failure on cygwin
Commit 6fd1106 ("t3700: Skip a test with backslashes in pathspec", 2009-03-13) introduced the BSLASHPSPEC prerequisite. This prerequisite allows tests to check for systems that can use backslashes in pathspecs (e.g. to escape glob special characters). On windows (and cygwin), this does not work because backslashes are used as directory separators, and git eagerly converts them to forward slashes. This test file uses the FUNNYNAMES prerequisite to skip this test file on windows, despite not really being appropriate for this test, which does not hold on cygwin. The FUNNYNAMES prerequisite is set when the system can create files with embedded quotes ("), tabs or newlines in the name. Since cygwin can satisfy FUNNYNAMES, but not BSLASHPSPEC, this leads to test failures on cygwin. In order to skip these tests on cygwin, replace the FUNNYNAMES prerequisite with BSLASHPSPEC, so that this test file is skipped on both windows and cygwin. While here, fix a few test titles as well. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16bd9f2 commit cf7efa4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

t/t6137-pathspec-wildcards-literal.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ test_description='test wildcards and literals with git add/commit (subshell styl
33

44
. ./test-lib.sh
55

6-
test_have_prereq FUNNYNAMES || {
7-
skip_all='skipping: needs FUNNYNAMES (non-Windows only)'
6+
test_have_prereq BSLASHPSPEC || {
7+
skip_all='skipping: needs BSLASHPSPEC (backslashes in pathspecs)'
88
test_done
99
}
1010

@@ -184,7 +184,7 @@ test_expect_success 'add wildcard f?z' '
184184
)
185185
'
186186

187-
test_expect_success 'add literal \? literal' '
187+
test_expect_success 'add literal \?' '
188188
git init test-q-lit &&
189189
(
190190
cd test-q-lit &&
@@ -241,7 +241,7 @@ test_expect_success 'add literal hello\?world' '
241241
)
242242
'
243243

244-
test_expect_success 'add literal [abc]' '
244+
test_expect_success 'add literal \[abc\]' '
245245
git init test-brackets-lit &&
246246
(
247247
cd test-brackets-lit &&
@@ -280,7 +280,7 @@ test_expect_success 'commit: wildcard *' '
280280
)
281281
'
282282

283-
test_expect_success 'commit: literal *' '
283+
test_expect_success 'commit: literal \*' '
284284
git init test-c-asterisk-lit &&
285285
(
286286
cd test-c-asterisk-lit &&
@@ -328,7 +328,7 @@ test_expect_success 'commit: literal f\*' '
328328
)
329329
'
330330

331-
test_expect_success 'commit: wildcard pathspec limits commit' '
331+
test_expect_success 'commit: wildcard f**' '
332332
git init test-c-pathlimit &&
333333
(
334334
cd test-c-pathlimit &&

0 commit comments

Comments
 (0)