Skip to content

Commit a023186

Browse files
TaoKgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent abf474a commit a023186

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

t/t7063-status-untracked-cache.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,38 @@ test_expect_success 'untracked cache after second status' '
190190
test_cmp ../dump.expect ../actual
191191
'
192192

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+
193225
test_expect_success 'modify in root directory, one dir invalidation' '
194226
: >four &&
195227
test-tool chmtime =-240 four &&

0 commit comments

Comments
 (0)