aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Klerks <tao@klerks.biz>2022-03-31 16:02:14 +0000
committerJunio C Hamano <gitster@pobox.com>2022-04-01 10:16:42 -0700
commita0231869a6d656f1cc9402084898666308d364ef (patch)
tree926d6f3139b303d21288290985a9d12a73c89f1d
parentThe 15th batch (diff)
downloadgit-a0231869a6d656f1cc9402084898666308d364ef.tar.gz
git-a0231869a6d656f1cc9402084898666308d364ef.zip
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>
-rwxr-xr-xt/t7063-status-untracked-cache.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index ca90ee805e..b89be8dc6d 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -190,6 +190,38 @@ test_expect_success 'untracked cache after second status' '
test_cmp ../dump.expect ../actual
'
+cat >../status_uall.expect <<EOF &&
+A done/one
+A one
+A two
+?? dthree/three
+?? dtwo/two
+?? three
+EOF
+
+# Bypassing the untracked cache here is not desirable from an
+# end-user perspective, but is expected in the current design.
+# The untracked cache data stored for a -unormal run cannot be
+# correctly used in a -uall run - it would yield incorrect output.
+test_expect_success 'untracked cache is bypassed with -uall' '
+ : >../trace.output &&
+ GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
+ git status -uall --porcelain >../actual &&
+ iuc status -uall --porcelain >../status.iuc &&
+ test_cmp ../status_uall.expect ../status.iuc &&
+ test_cmp ../status_uall.expect ../actual &&
+ get_relevant_traces ../trace.output ../trace.relevant &&
+ cat >../trace.expect <<EOF &&
+ ....path:
+EOF
+ test_cmp ../trace.expect ../trace.relevant
+'
+
+test_expect_success 'untracked cache remains after bypass' '
+ test-tool dump-untracked-cache >../actual &&
+ test_cmp ../dump.expect ../actual
+'
+
test_expect_success 'modify in root directory, one dir invalidation' '
: >four &&
test-tool chmtime =-240 four &&