3 test_description
='git p4 wildcards'
7 test_expect_success
'start p4d' '
11 test_expect_success
'add p4 files with wildcards in the names' '
14 printf "file2\nhas\nsome\nrandom\ntext\n" >file2 &&
16 echo file-wild-hash >file-wild#hash &&
17 echo file-wild-star >file-wild\*star &&
18 echo file-wild-at >file-wild@at &&
19 echo file-wild-percent >file-wild%percent &&
20 p4 add -f file-wild* &&
21 p4 submit -d "file wildcards"
25 test_expect_success
'wildcard files git p4 clone' '
26 git p4 clone --dest="$git" //depot &&
27 test_when_finished cleanup_git &&
30 test -f file-wild#hash &&
31 test -f file-wild\*star &&
32 test -f file-wild@at &&
33 test -f file-wild%percent
37 test_expect_success
'wildcard files submit back to p4, add' '
38 test_when_finished cleanup_git &&
39 git p4 clone --dest="$git" //depot &&
42 echo git-wild-hash >git-wild#hash &&
43 echo git-wild-star >git-wild\*star &&
44 echo git-wild-at >git-wild@at &&
45 echo git-wild-percent >git-wild%percent &&
47 git commit -m "add some wildcard filenames" &&
48 git config git-p4.skipSubmitEdit true &&
53 test_path_is_file git-wild#hash &&
54 test_path_is_file git-wild\*star &&
55 test_path_is_file git-wild@at &&
56 test_path_is_file git-wild%percent
60 test_expect_success
'wildcard files submit back to p4, modify' '
61 test_when_finished cleanup_git &&
62 git p4 clone --dest="$git" //depot &&
65 echo new-line >>git-wild#hash &&
66 echo new-line >>git-wild\*star &&
67 echo new-line >>git-wild@at &&
68 echo new-line >>git-wild%percent &&
70 git commit -m "modify the wildcard files" &&
71 git config git-p4.skipSubmitEdit true &&
76 test_line_count = 2 git-wild#hash &&
77 test_line_count = 2 git-wild\*star &&
78 test_line_count = 2 git-wild@at &&
79 test_line_count = 2 git-wild%percent
83 test_expect_success
'wildcard files submit back to p4, copy' '
84 test_when_finished cleanup_git &&
85 git p4 clone --dest="$git" //depot &&
88 cp file2 git-wild-cp#hash &&
89 git add git-wild-cp#hash &&
90 cp git-wild\*star file-wild-3 &&
91 git add file-wild-3 &&
92 git commit -m "wildcard copies" &&
93 git config git-p4.detectCopies true &&
94 git config git-p4.detectCopiesHarder true &&
95 git config git-p4.skipSubmitEdit true &&
100 test_path_is_file git-wild-cp#hash &&
101 test_path_is_file file-wild-3
105 test_expect_success
'wildcard files submit back to p4, rename' '
106 test_when_finished cleanup_git &&
107 git p4 clone --dest="$git" //depot &&
110 git mv git-wild@at file-wild-4 &&
111 git mv file-wild-3 git-wild-cp%percent &&
112 git commit -m "wildcard renames" &&
113 git config git-p4.detectRenames true &&
114 git config git-p4.skipSubmitEdit true &&
119 test_path_is_missing git-wild@at &&
120 test_path_is_file git-wild-cp%percent
124 test_expect_success
'wildcard files submit back to p4, delete' '
125 test_when_finished cleanup_git &&
126 git p4 clone --dest="$git" //depot &&
130 git commit -m "delete the wildcard files" &&
131 git config git-p4.skipSubmitEdit true &&
136 test_path_is_missing git-wild#hash &&
137 test_path_is_missing git-wild\*star &&
138 test_path_is_missing git-wild@at &&
139 test_path_is_missing git-wild%percent
143 test_expect_success
'kill p4d' '