18
: >untracked/ignored &&
19
: >untracked/uncommitted &&
20
git status --porcelain --ignored >actual &&
21
+ test_filter_gitconfig actual &&
22
test_cmp expected actual
23
'
24
28
: >untracked/ignored &&
29
: >untracked/uncommitted &&
30
git status --porcelain --ignored >actual &&
31
+ test_filter_gitconfig actual &&
32
test_cmp expected actual
33
'
34
42
test_expect_success 'status untracked files --ignored with pathspec (literal match)' '
43
git status --porcelain --ignored -- untracked/ignored >actual &&
44
echo "!! untracked/ignored" >expected &&
45
+ test_filter_gitconfig actual &&
46
test_cmp expected actual &&
47
git status --porcelain --ignored -- untracked/uncommitted >actual &&
48
echo "?? untracked/uncommitted" >expected &&
49
+ test_filter_gitconfig actual &&
50
test_cmp expected actual
51
'
52
53
test_expect_success 'status untracked files --ignored with pathspec (glob match)' '
54
git status --porcelain --ignored -- untracked/i\* >actual &&
55
echo "!! untracked/ignored" >expected &&
56
+ test_filter_gitconfig actual &&
57
test_cmp expected actual &&
58
git status --porcelain --ignored -- untracked/u\* >actual &&
59
echo "?? untracked/uncommitted" >expected &&
60
+ test_filter_gitconfig actual &&
61
test_cmp expected actual
62
'
63
71
72
test_expect_success 'status untracked directory with --ignored -u' '
73
git status --porcelain --ignored -u >actual &&
74
+ test_filter_gitconfig actual &&
75
test_cmp expected actual
76
'
77
cat >expected <<\EOF
83
git status --porcelain --ignored >tmp &&
84
grep untracked/ tmp >actual &&
85
rm tmp &&
86
+ test_filter_gitconfig actual &&
87
test_cmp expected actual &&
88
89
git status --porcelain --ignored untracked/ >actual &&
90
+ test_filter_gitconfig actual &&
91
test_cmp expected actual
92
'
93
98
99
test_expect_success 'status prefixed untracked sub-directory with --ignored -u' '
100
git status --porcelain --ignored -u untracked/ >actual &&
101
+ test_filter_gitconfig actual &&
102
test_cmp expected actual
103
'
104
114
mkdir ignored &&
115
: >ignored/uncommitted &&
116
git status --porcelain --ignored >actual &&
117
+ test_filter_gitconfig actual &&
118
test_cmp expected actual
119
'
120
127
128
test_expect_success 'status ignored directory with --ignore -u' '
129
git status --porcelain --ignored -u >actual &&
130
+ test_filter_gitconfig actual &&
131
test_cmp expected actual
132
'
133
142
mkdir untracked-ignored &&
143
mkdir untracked-ignored/test &&
144
git status --porcelain --ignored >actual &&
145
+ test_filter_gitconfig actual &&
146
test_cmp expected actual
147
'
148
154
155
test_expect_success 'status empty untracked directory with --ignore -u' '
156
git status --porcelain --ignored -u >actual &&
157
+ test_filter_gitconfig actual &&
158
test_cmp expected actual
159
'
160
169
: >untracked-ignored/ignored &&
170
: >untracked-ignored/test/ignored &&
171
git status --porcelain --ignored >actual &&
172
+ test_filter_gitconfig actual &&
173
test_cmp expected actual
174
'
175
183
184
test_expect_success 'status untracked directory with ignored files with --ignore -u' '
185
git status --porcelain --ignored -u >actual &&
186
+ test_filter_gitconfig actual &&
187
test_cmp expected actual
188
'
189
201
git commit -m. &&
202
echo "tracked" >.gitignore &&
203
git status --porcelain --ignored >actual &&
204
+ test_filter_gitconfig actual &&
205
test_cmp expected actual
206
'
207
213
214
test_expect_success 'status ignored tracked directory with --ignore -u' '
215
git status --porcelain --ignored -u >actual &&
216
+ test_filter_gitconfig actual &&
217
test_cmp expected actual
218
'
219
226
test_expect_success 'status ignored tracked directory and ignored file with --ignore' '
227
echo "committed" >>.gitignore &&
228
git status --porcelain --ignored >actual &&
229
+ test_filter_gitconfig actual &&
230
test_cmp expected actual
231
'
232
238
239
test_expect_success 'status ignored tracked directory and ignored file with --ignore -u' '
240
git status --porcelain --ignored -u >actual &&
241
+ test_filter_gitconfig actual &&
242
test_cmp expected actual
243
'
244
253
echo "tracked" >.gitignore &&
254
: >tracked/uncommitted &&
255
git status --porcelain --ignored >actual &&
256
+ test_filter_gitconfig actual &&
257
test_cmp expected actual
258
'
259
266
267
test_expect_success 'status ignored tracked directory and uncommitted file with --ignore -u' '
268
git status --porcelain --ignored -u >actual &&
269
+ test_filter_gitconfig actual &&
270
test_cmp expected actual
271
'
272
282
mkdir tracked/ignored &&
283
: >tracked/ignored/uncommitted &&
284
git status --porcelain --ignored >actual &&
285
+ test_filter_gitconfig actual &&
286
test_cmp expected actual
287
'
288
295
296
test_expect_success 'status ignored tracked directory with uncommitted file in untracked subdir with --ignore -u' '
297
git status --porcelain --ignored -u >actual &&
298
+ test_filter_gitconfig actual &&
299
test_cmp expected actual
300
'
301
311
git add -f tracked/ignored/committed &&
312
git commit -m. &&
313
git status --porcelain --ignored >actual &&
314
+ test_filter_gitconfig actual &&
315
test_cmp expected actual
316
'
317
324
325
test_expect_success 'status ignored tracked directory with uncommitted file in tracked subdir with --ignore -u' '
326
git status --porcelain --ignored -u >actual &&
327
+ test_filter_gitconfig actual &&
328
test_cmp expected actual
329
'
330
336
git init tracked/submodule &&
337
test_commit -C tracked/submodule initial &&
338
git status --porcelain --ignored -u tracked/submodule >actual &&
339
+ test_filter_gitconfig actual &&
340
test_cmp expected actual
341
'
342