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>

Pete Wyckoff committed Jan 26, 2013 at 22:11 UTC 9d01ae9f20435b90619c909e9cbb9ca29f7de494
2 files changed +37 -10
t/t9809-git-p4-client-view.sh
+8 -2
@@ -365,7 +365,10 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
365 (
366 cd "$git" &&
367 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 &&
372 echo git-wild-at >dir1/git-wild@at &&
373 echo git-wild-percent >dir1/git-wild%percent &&
374 git add dir1/git-wild* &&
@@ -376,7 +379,10 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
379 (
380 cd "$cli" &&
381 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 &&
386 test_path_is_file dir1/git-wild@at &&
387 test_path_is_file dir1/git-wild%percent
388 ) &&
t/t9812-git-p4-wildcards.sh
+29 -8
@@ -14,7 +14,10 @@ test_expect_success 'add p4 files with wildcards in the names' '
14 printf "file2\nhas\nsome\nrandom\ntext\n" >file2 &&
15 p4 add file2 &&
16 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 &&
21 echo file-wild-at >file-wild@at &&
22 echo file-wild-percent >file-wild%percent &&
23 p4 add -f file-wild* &&
@@ -28,7 +31,10 @@ test_expect_success 'wildcard files git p4 clone' '
31 (
32 cd "$git" &&
33 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 &&
38 test -f file-wild@at &&
39 test -f file-wild%percent
40 )
@@ -40,7 +46,10 @@ test_expect_success 'wildcard files submit back to p4, add' '
46 (
47 cd "$git" &&
48 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 &&
53 echo git-wild-at >git-wild@at &&
54 echo git-wild-percent >git-wild%percent &&
55 git add git-wild* &&
@@ -51,7 +60,10 @@ test_expect_success 'wildcard files submit back to p4, add' '
60 (
61 cd "$cli" &&
62 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 &&
67 test_path_is_file git-wild@at &&
68 test_path_is_file git-wild%percent
69 )
@@ -63,7 +75,10 @@ test_expect_success 'wildcard files submit back to p4, modify' '
75 (
76 cd "$git" &&
77 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 &&
82 echo new-line >>git-wild@at &&
83 echo new-line >>git-wild%percent &&
84 git add git-wild* &&
@@ -74,7 +89,10 @@ test_expect_success 'wildcard files submit back to p4, modify' '
89 (
90 cd "$cli" &&
91 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 &&
96 test_line_count = 2 git-wild@at &&
97 test_line_count = 2 git-wild%percent
98 )
@@ -87,7 +105,7 @@ test_expect_success 'wildcard files submit back to p4, copy' '
105 cd "$git" &&
106 cp file2 git-wild-cp#hash &&
107 git add git-wild-cp#hash &&
90 - cp git-wild\*star file-wild-3 &&
108 + cp git-wild#hash file-wild-3 &&
109 git add file-wild-3 &&
110 git commit -m "wildcard copies" &&
111 git config git-p4.detectCopies true &&
@@ -134,7 +152,10 @@ test_expect_success 'wildcard files submit back to p4, delete' '
152 (
153 cd "$cli" &&
154 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 &&
159 test_path_is_missing git-wild@at &&
160 test_path_is_missing git-wild%percent
161 )