Skip to content

Commit 9d01ae9

Browse files
Pete Wyckoffgitster
authored andcommitted
git p4 test: avoid wildcard * in windows
This character is not valid in windows filenames, even though it can appear in p4 depot paths. Avoid using it in tests on windows, both mingw and cygwin. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent e93f869 commit 9d01ae9

2 files changed

Lines changed: 37 additions & 10 deletions

File tree

t/t9809-git-p4-client-view.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
365365
(
366366
cd "$git" &&
367367
echo git-wild-hash >dir1/git-wild#hash &&
368-
echo git-wild-star >dir1/git-wild\*star &&
368+
if test_have_prereq NOT_MINGW NOT_CYGWIN
369+
then
370+
echo git-wild-star >dir1/git-wild\*star
371+
fi &&
369372
echo git-wild-at >dir1/git-wild@at &&
370373
echo git-wild-percent >dir1/git-wild%percent &&
371374
git add dir1/git-wild* &&
@@ -376,7 +379,10 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
376379
(
377380
cd "$cli" &&
378381
test_path_is_file dir1/git-wild#hash &&
379-
test_path_is_file dir1/git-wild\*star &&
382+
if test_have_prereq NOT_MINGW NOT_CYGWIN
383+
then
384+
test_path_is_file dir1/git-wild\*star
385+
fi &&
380386
test_path_is_file dir1/git-wild@at &&
381387
test_path_is_file dir1/git-wild%percent
382388
) &&

t/t9812-git-p4-wildcards.sh

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ test_expect_success 'add p4 files with wildcards in the names' '
1414
printf "file2\nhas\nsome\nrandom\ntext\n" >file2 &&
1515
p4 add file2 &&
1616
echo file-wild-hash >file-wild#hash &&
17-
echo file-wild-star >file-wild\*star &&
17+
if test_have_prereq NOT_MINGW NOT_CYGWIN
18+
then
19+
echo file-wild-star >file-wild\*star
20+
fi &&
1821
echo file-wild-at >file-wild@at &&
1922
echo file-wild-percent >file-wild%percent &&
2023
p4 add -f file-wild* &&
@@ -28,7 +31,10 @@ test_expect_success 'wildcard files git p4 clone' '
2831
(
2932
cd "$git" &&
3033
test -f file-wild#hash &&
31-
test -f file-wild\*star &&
34+
if test_have_prereq NOT_MINGW NOT_CYGWIN
35+
then
36+
test -f file-wild\*star
37+
fi &&
3238
test -f file-wild@at &&
3339
test -f file-wild%percent
3440
)
@@ -40,7 +46,10 @@ test_expect_success 'wildcard files submit back to p4, add' '
4046
(
4147
cd "$git" &&
4248
echo git-wild-hash >git-wild#hash &&
43-
echo git-wild-star >git-wild\*star &&
49+
if test_have_prereq NOT_MINGW NOT_CYGWIN
50+
then
51+
echo git-wild-star >git-wild\*star
52+
fi &&
4453
echo git-wild-at >git-wild@at &&
4554
echo git-wild-percent >git-wild%percent &&
4655
git add git-wild* &&
@@ -51,7 +60,10 @@ test_expect_success 'wildcard files submit back to p4, add' '
5160
(
5261
cd "$cli" &&
5362
test_path_is_file git-wild#hash &&
54-
test_path_is_file git-wild\*star &&
63+
if test_have_prereq NOT_MINGW NOT_CYGWIN
64+
then
65+
test_path_is_file git-wild\*star
66+
fi &&
5567
test_path_is_file git-wild@at &&
5668
test_path_is_file git-wild%percent
5769
)
@@ -63,7 +75,10 @@ test_expect_success 'wildcard files submit back to p4, modify' '
6375
(
6476
cd "$git" &&
6577
echo new-line >>git-wild#hash &&
66-
echo new-line >>git-wild\*star &&
78+
if test_have_prereq NOT_MINGW NOT_CYGWIN
79+
then
80+
echo new-line >>git-wild\*star
81+
fi &&
6782
echo new-line >>git-wild@at &&
6883
echo new-line >>git-wild%percent &&
6984
git add git-wild* &&
@@ -74,7 +89,10 @@ test_expect_success 'wildcard files submit back to p4, modify' '
7489
(
7590
cd "$cli" &&
7691
test_line_count = 2 git-wild#hash &&
77-
test_line_count = 2 git-wild\*star &&
92+
if test_have_prereq NOT_MINGW NOT_CYGWIN
93+
then
94+
test_line_count = 2 git-wild\*star
95+
fi &&
7896
test_line_count = 2 git-wild@at &&
7997
test_line_count = 2 git-wild%percent
8098
)
@@ -87,7 +105,7 @@ test_expect_success 'wildcard files submit back to p4, copy' '
87105
cd "$git" &&
88106
cp file2 git-wild-cp#hash &&
89107
git add git-wild-cp#hash &&
90-
cp git-wild\*star file-wild-3 &&
108+
cp git-wild#hash file-wild-3 &&
91109
git add file-wild-3 &&
92110
git commit -m "wildcard copies" &&
93111
git config git-p4.detectCopies true &&
@@ -134,7 +152,10 @@ test_expect_success 'wildcard files submit back to p4, delete' '
134152
(
135153
cd "$cli" &&
136154
test_path_is_missing git-wild#hash &&
137-
test_path_is_missing git-wild\*star &&
155+
if test_have_prereq NOT_MINGW NOT_CYGWIN
156+
then
157+
test_path_is_missing git-wild\*star
158+
fi &&
138159
test_path_is_missing git-wild@at &&
139160
test_path_is_missing git-wild%percent
140161
)

0 commit comments

Comments
 (0)