@@ -6274,6 +6274,102 @@ test_expect_success UNTRACKED_CACHE,SEMANTIC_VERIFY_ANCHORED_OPEN \
62746274 )
62756275'
62766276
6277+ test_expect_success UNTRACKED_CACHE,SEMANTIC_VERIFY_ANCHORED_OPEN \
6278+ ' command-scoped preload tuning preserves configured filter history' '
6279+ test_when_finished "rm -rf configured-filter-preload" &&
6280+ test_create_repo configured-filter-preload &&
6281+ (
6282+ cd configured-filter-preload &&
6283+ sane_unset GIT_TEST_SPLIT_INDEX &&
6284+ mkdir nested &&
6285+ test_write_lines base >tracked &&
6286+ test_write_lines sibling >nested/tracked &&
6287+ test_write_lines "*.filtered filter=demo" \
6288+ "*.processed filter=protocol" >.gitattributes &&
6289+ git add .gitattributes tracked nested/tracked &&
6290+ git commit -m base &&
6291+ git config filter.demo.clean cat &&
6292+ git config filter.protocol.process \
6293+ "test-tool rot13-filter --log=.git/filter-process.log clean smudge" &&
6294+ git config core.untrackedCache true &&
6295+ git config core.fsmonitor true &&
6296+ GIT_TEST_FSMONITOR_QUERY_SEQUENCE=C \
6297+ git update-index --fsmonitor &&
6298+ GIT_INDEX_FILE="$PWD/.git/index" \
6299+ GIT_TEST_FSMONITOR_QUERY_SEQUENCE=CCCCCC \
6300+ GIT_TRACE2_EVENT="$PWD/.git/prime.trace" \
6301+ git status --porcelain=v2 >.git/prime &&
6302+ test_must_be_empty .git/prime &&
6303+ test_trace2_data fsmonitor filter-scope/valid 1 \
6304+ <.git/prime.trace &&
6305+ test_grep FSCF .git/index &&
6306+ test_grep FSUC .git/index &&
6307+
6308+ for label in bulk preload both bulk-false preload-false
6309+ do
6310+ case "$label" in
6311+ bulk) set -- -c core.preloadIndexBulk ;;
6312+ preload) set -- -c core.preloadIndex ;;
6313+ both) set -- -c core.preloadIndexBulk -c core.preloadIndex ;;
6314+ bulk-false) set -- -c core.preloadIndexBulk=false ;;
6315+ preload-false) set -- -c core.preloadIndex=false ;;
6316+ esac &&
6317+ GIT_TEST_FSMONITOR_QUERY_SEQUENCE=CCCCCC \
6318+ GIT_TRACE2_EVENT="$PWD/.git/$label.trace" \
6319+ git "$@" status --porcelain=v2 >.git/$label &&
6320+ test_must_be_empty .git/$label &&
6321+ test_trace2_data fsmonitor config/coherent 1 \
6322+ <.git/$label.trace &&
6323+ ! test_trace2_data fsmonitor semantic/initial-mismatch 1 \
6324+ <.git/$label.trace &&
6325+ ! have_t2_data_event fsmonitor semantic/manifest-scan-count \
6326+ <.git/$label.trace &&
6327+ ! test_trace2_data fsmonitor semantic/strong-invalidation 1 \
6328+ <.git/$label.trace &&
6329+ ! test_trace2_data index refresh/sum_lstat \
6330+ "[1-9][0-9]*" <.git/$label.trace &&
6331+ GIT_TEST_FSMONITOR_QUERY_SEQUENCE=CCCCCC \
6332+ GIT_TRACE2_EVENT="$PWD/.git/$label-plain.trace" \
6333+ git status --porcelain=v2 >.git/$label-plain &&
6334+ test_must_be_empty .git/$label-plain &&
6335+ test_trace2_data fsmonitor config/coherent 1 \
6336+ <.git/$label-plain.trace &&
6337+ ! have_t2_data_event fsmonitor semantic/manifest-scan-count \
6338+ <.git/$label-plain.trace || return 1
6339+ done &&
6340+
6341+ git config core.preloadIndexBulk true &&
6342+ GIT_TEST_FSMONITOR_QUERY_SEQUENCE=CCCCCC \
6343+ GIT_TRACE2_EVENT="$PWD/.git/persistent.trace" \
6344+ git status --porcelain=v2 >.git/persistent &&
6345+ test_must_be_empty .git/persistent &&
6346+ test_trace2_data fsmonitor config/coherent 0 \
6347+ <.git/persistent.trace &&
6348+ test_trace2_data fsmonitor semantic/manifest-scan-count 1 \
6349+ <.git/persistent.trace &&
6350+
6351+ git config core.filemode false &&
6352+ chmod +x tracked &&
6353+ GIT_INDEX_FILE="$PWD/.git/index" \
6354+ GIT_TEST_FSMONITOR_QUERY_SEQUENCE=CCCCCC \
6355+ git status --porcelain=v2 >.git/filemode-prime &&
6356+ test_must_be_empty .git/filemode-prime &&
6357+ GIT_OPTIONAL_LOCKS=0 git -c core.fsmonitor=false \
6358+ -c core.untrackedCache=false -c core.filemode=true \
6359+ status --porcelain=v2 >.git/filemode.expect &&
6360+ test_grep "^1 \\.M .* tracked$" .git/filemode.expect &&
6361+ GIT_TEST_FSMONITOR_QUERY_SEQUENCE=CCCCCC \
6362+ GIT_TRACE2_EVENT="$PWD/.git/filemode.trace" \
6363+ git -c core.filemode=true status --porcelain=v2 \
6364+ >.git/filemode.actual &&
6365+ test_cmp .git/filemode.expect .git/filemode.actual &&
6366+ test_trace2_data fsmonitor config/coherent 0 \
6367+ <.git/filemode.trace &&
6368+ test_trace2_data fsmonitor semantic/manifest-scan-count 1 \
6369+ <.git/filemode.trace
6370+ )
6371+ '
6372+
62776373test_expect_success SEMANTIC_VERIFY_ANCHORED_OPEN \
62786374 ' sparse index rebuilds semantic history without expansion' '
62796375 test_when_finished "rm -rf sparse-semantic" &&
0 commit comments