untracked-cache: test untracked-cache-bypassing behavior with -uall
Untracked cache was originally designed to only work with '--untracked-files=normal', and it gets ignored when '--untracked-files=all' is specified instead. Add explicit tests for this known as-designed behavior. Signed-off-by: Tao Klerks <tao@klerks.biz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tao Klerks committed
Mar 31, 2022 at 16:02 UTC
a0231869a6d656f1cc9402084898666308d364ef
1 file changed
+32
t/t7063-status-untracked-cache.sh
+32
@@ -190,6 +190,38 @@ test_expect_success 'untracked cache after second status' '
190
test_cmp ../dump.expect ../actual
191
'
192
193
+cat >../status_uall.expect <<EOF &&
194
+A done/one
195
+A one
196
+A two
197
+?? dthree/three
198
+?? dtwo/two
199
+?? three
200
+EOF
201
+
202
+# Bypassing the untracked cache here is not desirable from an
203
+# end-user perspective, but is expected in the current design.
204
+# The untracked cache data stored for a -unormal run cannot be
205
+# correctly used in a -uall run - it would yield incorrect output.
206
+test_expect_success 'untracked cache is bypassed with -uall' '
207
+ : >../trace.output &&
208
+ GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
209
+ git status -uall --porcelain >../actual &&
210
+ iuc status -uall --porcelain >../status.iuc &&
211
+ test_cmp ../status_uall.expect ../status.iuc &&
212
+ test_cmp ../status_uall.expect ../actual &&
213
+ get_relevant_traces ../trace.output ../trace.relevant &&
214
+ cat >../trace.expect <<EOF &&
215
+ ....path:
216
+EOF
217
+ test_cmp ../trace.expect ../trace.relevant
218
+'
219
+
220
+test_expect_success 'untracked cache remains after bypass' '
221
+ test-tool dump-untracked-cache >../actual &&
222
+ test_cmp ../dump.expect ../actual
223
+'
224
+
225
test_expect_success 'modify in root directory, one dir invalidation' '
226
: >four &&
227
test-tool chmtime =-240 four &&