3 test_description
='git-status ignored files'
15 test_expect_success
'status untracked directory with --ignored' '
16 echo "ignored" >.gitignore &&
18 : >untracked/ignored &&
19 : >untracked/uncommitted &&
20 git status --porcelain --ignored >actual &&
21 test_cmp expected actual
24 test_expect_success
'same with gitignore starting with BOM' '
25 printf "\357\273\277ignored\n" >.gitignore &&
27 : >untracked/ignored &&
28 : >untracked/uncommitted &&
29 git status --porcelain --ignored >actual &&
30 test_cmp expected actual
37 ?? untracked
/uncommitted
41 test_expect_success
'status untracked directory with --ignored -u' '
42 git status --porcelain --ignored -u >actual &&
43 test_cmp expected actual
46 ?? untracked
/uncommitted
50 test_expect_success
'status prefixed untracked directory with --ignored' '
51 git status --porcelain --ignored untracked/ >actual &&
52 test_cmp expected actual
56 ?? untracked
/uncommitted
60 test_expect_success
'status prefixed untracked sub-directory with --ignored -u' '
61 git status --porcelain --ignored -u untracked/ >actual &&
62 test_cmp expected actual
72 test_expect_success
'status ignored directory with --ignore' '
75 : >ignored/uncommitted &&
76 git status --porcelain --ignored >actual &&
77 test_cmp expected actual
84 !! ignored
/uncommitted
87 test_expect_success
'status ignored directory with --ignore -u' '
88 git status --porcelain --ignored -u >actual &&
89 test_cmp expected actual
98 test_expect_success
'status empty untracked directory with --ignore' '
100 mkdir untracked-ignored &&
101 mkdir untracked-ignored/test &&
102 git status --porcelain --ignored >actual &&
103 test_cmp expected actual
112 test_expect_success
'status empty untracked directory with --ignore -u' '
113 git status --porcelain --ignored -u >actual &&
114 test_cmp expected actual
121 !! untracked-ignored
/
124 test_expect_success
'status untracked directory with ignored files with --ignore' '
125 : >untracked-ignored/ignored &&
126 : >untracked-ignored/test/ignored &&
127 git status --porcelain --ignored >actual &&
128 test_cmp expected actual
135 !! untracked-ignored
/ignored
136 !! untracked-ignored
/test
/ignored
139 test_expect_success
'status untracked directory with ignored files with --ignore -u' '
140 git status --porcelain --ignored -u >actual &&
141 test_cmp expected actual
150 test_expect_success
'status ignored tracked directory with --ignore' '
151 rm -rf untracked-ignored &&
153 : >tracked/committed &&
154 git add tracked/committed &&
156 echo "tracked" >.gitignore &&
157 git status --porcelain --ignored >actual &&
158 test_cmp expected actual
167 test_expect_success
'status ignored tracked directory with --ignore -u' '
168 git status --porcelain --ignored -u >actual &&
169 test_cmp expected actual
178 test_expect_success
'status ignored tracked directory and ignored file with --ignore' '
179 echo "committed" >>.gitignore &&
180 git status --porcelain --ignored >actual &&
181 test_cmp expected actual
190 test_expect_success
'status ignored tracked directory and ignored file with --ignore -u' '
191 git status --porcelain --ignored -u >actual &&
192 test_cmp expected actual
199 !! tracked
/uncommitted
202 test_expect_success
'status ignored tracked directory and uncommitted file with --ignore' '
203 echo "tracked" >.gitignore &&
204 : >tracked/uncommitted &&
205 git status --porcelain --ignored >actual &&
206 test_cmp expected actual
213 !! tracked
/uncommitted
216 test_expect_success
'status ignored tracked directory and uncommitted file with --ignore -u' '
217 git status --porcelain --ignored -u >actual &&
218 test_cmp expected actual
228 test_expect_success
'status ignored tracked directory with uncommitted file in untracked subdir with --ignore' '
229 rm -rf tracked/uncommitted &&
230 mkdir tracked/ignored &&
231 : >tracked/ignored/uncommitted &&
232 git status --porcelain --ignored >actual &&
233 test_cmp expected actual
240 !! tracked
/ignored
/uncommitted
243 test_expect_success
'status ignored tracked directory with uncommitted file in untracked subdir with --ignore -u' '
244 git status --porcelain --ignored -u >actual &&
245 test_cmp expected actual
252 !! tracked
/ignored
/uncommitted
255 test_expect_success
'status ignored tracked directory with uncommitted file in tracked subdir with --ignore' '
256 : >tracked/ignored/committed &&
257 git add -f tracked/ignored/committed &&
259 git status --porcelain --ignored >actual &&
260 test_cmp expected actual
267 !! tracked
/ignored
/uncommitted
270 test_expect_success
'status ignored tracked directory with uncommitted file in tracked subdir with --ignore -u' '
271 git status --porcelain --ignored -u >actual &&
272 test_cmp expected actual
276 !! tracked
/submodule
/
279 test_expect_success
'status ignores submodule in excluded directory' '
280 git init tracked/submodule &&
281 test_commit -C tracked/submodule initial &&
282 git status --porcelain --ignored -u tracked/submodule >actual &&
283 test_cmp expected actual