3 test_description='git-status ignored files'
14 test_expect_success 'status untracked directory with --ignored' '
15 echo "ignored" >.gitignore &&
17 : >untracked/ignored &&
18 : >untracked/uncommitted &&
19 git status --porcelain --ignored >actual &&
20 test_cmp expected actual
23 test_expect_success 'same with gitignore starting with BOM' '
24 printf "\357\273\277ignored\n" >.gitignore &&
26 : >untracked/ignored &&
27 : >untracked/uncommitted &&
28 git status --porcelain --ignored >actual &&
29 test_cmp expected actual
36 ?? untracked/uncommitted
40 test_expect_success 'status untracked directory with --ignored -u' '
41 git status --porcelain --ignored -u >actual &&
42 test_cmp expected actual
45 ?? untracked/uncommitted
49 test_expect_success 'status prefixed untracked directory with --ignored' '
50 git status --porcelain --ignored untracked/ >actual &&
51 test_cmp expected actual
55 ?? untracked/uncommitted
59 test_expect_success 'status prefixed untracked sub-directory with --ignored -u' '
60 git status --porcelain --ignored -u untracked/ >actual &&
61 test_cmp expected actual
71 test_expect_success 'status ignored directory with --ignore' '
74 : >ignored/uncommitted &&
75 git status --porcelain --ignored >actual &&
76 test_cmp expected actual
83 !! ignored/uncommitted
86 test_expect_success 'status ignored directory with --ignore -u' '
87 git status --porcelain --ignored -u >actual &&
88 test_cmp expected actual
97 test_expect_success 'status empty untracked directory with --ignore' '
99 mkdir untracked-ignored &&
100 mkdir untracked-ignored/test &&
101 git status --porcelain --ignored >actual &&
102 test_cmp expected actual
111 test_expect_success 'status empty untracked directory with --ignore -u' '
112 git status --porcelain --ignored -u >actual &&
113 test_cmp expected actual
120 !! untracked-ignored/
123 test_expect_success 'status untracked directory with ignored files with --ignore' '
124 : >untracked-ignored/ignored &&
125 : >untracked-ignored/test/ignored &&
126 git status --porcelain --ignored >actual &&
127 test_cmp expected actual
134 !! untracked-ignored/ignored
135 !! untracked-ignored/test/ignored
138 test_expect_success 'status untracked directory with ignored files with --ignore -u' '
139 git status --porcelain --ignored -u >actual &&
140 test_cmp expected actual
149 test_expect_success 'status ignored tracked directory with --ignore' '
150 rm -rf untracked-ignored &&
152 : >tracked/committed &&
153 git add tracked/committed &&
155 echo "tracked" >.gitignore &&
156 git status --porcelain --ignored >actual &&
157 test_cmp expected actual
166 test_expect_success 'status ignored tracked directory with --ignore -u' '
167 git status --porcelain --ignored -u >actual &&
168 test_cmp expected actual
177 test_expect_success 'status ignored tracked directory and ignored file with --ignore' '
178 echo "committed" >>.gitignore &&
179 git status --porcelain --ignored >actual &&
180 test_cmp expected actual
189 test_expect_success 'status ignored tracked directory and ignored file with --ignore -u' '
190 git status --porcelain --ignored -u >actual &&
191 test_cmp expected actual
198 !! tracked/uncommitted
201 test_expect_success 'status ignored tracked directory and uncommitted file with --ignore' '
202 echo "tracked" >.gitignore &&
203 : >tracked/uncommitted &&
204 git status --porcelain --ignored >actual &&
205 test_cmp expected actual
212 !! tracked/uncommitted
215 test_expect_success 'status ignored tracked directory and uncommitted file with --ignore -u' '
216 git status --porcelain --ignored -u >actual &&
217 test_cmp expected actual
227 test_expect_success 'status ignored tracked directory with uncommitted file in untracked subdir with --ignore' '
228 rm -rf tracked/uncommitted &&
229 mkdir tracked/ignored &&
230 : >tracked/ignored/uncommitted &&
231 git status --porcelain --ignored >actual &&
232 test_cmp expected actual
239 !! tracked/ignored/uncommitted
242 test_expect_success 'status ignored tracked directory with uncommitted file in untracked subdir with --ignore -u' '
243 git status --porcelain --ignored -u >actual &&
244 test_cmp expected actual
251 !! tracked/ignored/uncommitted
254 test_expect_success 'status ignored tracked directory with uncommitted file in tracked subdir with --ignore' '
255 : >tracked/ignored/committed &&
256 git add -f tracked/ignored/committed &&
258 git status --porcelain --ignored >actual &&
259 test_cmp expected actual
266 !! tracked/ignored/uncommitted
269 test_expect_success 'status ignored tracked directory with uncommitted file in tracked subdir with --ignore -u' '
270 git status --porcelain --ignored -u >actual &&
271 test_cmp expected actual