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
27 ?? untracked
/uncommitted
31 test_expect_success
'status untracked directory with --ignored -u' '
32 git status --porcelain --ignored -u >actual &&
33 test_cmp expected actual
36 ?? untracked
/uncommitted
40 test_expect_success
'status prefixed untracked directory with --ignored' '
41 git status --porcelain --ignored untracked/ >actual &&
42 test_cmp expected actual
46 ?? untracked
/uncommitted
50 test_expect_success
'status prefixed untracked sub-directory with --ignored -u' '
51 git status --porcelain --ignored -u untracked/ >actual &&
52 test_cmp expected actual
62 test_expect_success
'status ignored directory with --ignore' '
65 : >ignored/uncommitted &&
66 git status --porcelain --ignored >actual &&
67 test_cmp expected actual
74 !! ignored
/uncommitted
77 test_expect_success
'status ignored directory with --ignore -u' '
78 git status --porcelain --ignored -u >actual &&
79 test_cmp expected actual
88 test_expect_success
'status empty untracked directory with --ignore' '
90 mkdir untracked-ignored &&
91 mkdir untracked-ignored/test &&
92 git status --porcelain --ignored >actual &&
93 test_cmp expected actual
102 test_expect_success
'status empty untracked directory with --ignore -u' '
103 git status --porcelain --ignored -u >actual &&
104 test_cmp expected actual
111 !! untracked-ignored
/
114 test_expect_success
'status untracked directory with ignored files with --ignore' '
115 : >untracked-ignored/ignored &&
116 : >untracked-ignored/test/ignored &&
117 git status --porcelain --ignored >actual &&
118 test_cmp expected actual
125 !! untracked-ignored
/ignored
126 !! untracked-ignored
/test
/ignored
129 test_expect_success
'status untracked directory with ignored files with --ignore -u' '
130 git status --porcelain --ignored -u >actual &&
131 test_cmp expected actual
140 test_expect_success
'status ignored tracked directory with --ignore' '
141 rm -rf untracked-ignored &&
143 : >tracked/committed &&
144 git add tracked/committed &&
146 echo "tracked" >.gitignore &&
147 git status --porcelain --ignored >actual &&
148 test_cmp expected actual
157 test_expect_success
'status ignored tracked directory with --ignore -u' '
158 git status --porcelain --ignored -u >actual &&
159 test_cmp expected actual
168 test_expect_success
'status ignored tracked directory and ignored file with --ignore' '
169 echo "committed" >>.gitignore &&
170 git status --porcelain --ignored >actual &&
171 test_cmp expected actual
180 test_expect_success
'status ignored tracked directory and ignored file with --ignore -u' '
181 git status --porcelain --ignored -u >actual &&
182 test_cmp expected actual
189 !! tracked
/uncommitted
192 test_expect_success
'status ignored tracked directory and uncommitted file with --ignore' '
193 echo "tracked" >.gitignore &&
194 : >tracked/uncommitted &&
195 git status --porcelain --ignored >actual &&
196 test_cmp expected actual
203 !! tracked
/uncommitted
206 test_expect_success
'status ignored tracked directory and uncommitted file with --ignore -u' '
207 git status --porcelain --ignored -u >actual &&
208 test_cmp expected actual
218 test_expect_success
'status ignored tracked directory with uncommitted file in untracked subdir with --ignore' '
219 rm -rf tracked/uncommitted &&
220 mkdir tracked/ignored &&
221 : >tracked/ignored/uncommitted &&
222 git status --porcelain --ignored >actual &&
223 test_cmp expected actual
230 !! tracked
/ignored
/uncommitted
233 test_expect_success
'status ignored tracked directory with uncommitted file in untracked subdir with --ignore -u' '
234 git status --porcelain --ignored -u >actual &&
235 test_cmp expected actual
242 !! tracked
/ignored
/uncommitted
245 test_expect_success
'status ignored tracked directory with uncommitted file in tracked subdir with --ignore' '
246 : >tracked/ignored/committed &&
247 git add -f tracked/ignored/committed &&
249 git status --porcelain --ignored >actual &&
250 test_cmp expected actual
257 !! tracked
/ignored
/uncommitted
260 test_expect_success
'status ignored tracked directory with uncommitted file in tracked subdir with --ignore -u' '
261 git status --porcelain --ignored -u >actual &&
262 test_cmp expected actual