aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-08-21 13:47:02 -0700
committerJunio C Hamano <gitster@pobox.com>2025-08-21 13:47:02 -0700
commitb4e38c1acd2242d97ce90cd4a9370567a3e5a424 (patch)
tree30b6ebdc404d64afc6e95fcf25ae3580c7630f69 /t
parentMerge branch 'en/ort-rename-fixes' (diff)
parentbloom: enable bloom filter with wildcard pathspec in revision traversal (diff)
downloadgit-b4e38c1acd2242d97ce90cd4a9370567a3e5a424.tar.gz
git-b4e38c1acd2242d97ce90cd4a9370567a3e5a424.zip
Merge branch 'ly/changed-path-traversal-with-magic-pathspec'
Revision traversal limited with pathspec, like "git log dir/*", used to ignore changed-paths Bloom filter when the pathspec contained wildcards; now they take advantage of the filter when they can. * ly/changed-path-traversal-with-magic-pathspec: bloom: enable bloom filter with wildcard pathspec in revision traversal
Diffstat (limited to 't')
-rwxr-xr-xt/t4216-log-bloom.sh31
1 files changed, 27 insertions, 4 deletions
diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh
index 639868ac56..1064990de3 100755
--- a/t/t4216-log-bloom.sh
+++ b/t/t4216-log-bloom.sh
@@ -154,11 +154,34 @@ test_expect_success 'git log with multiple literal paths uses Bloom filter' '
test_bloom_filters_used "-- file*"
'
-test_expect_success 'git log with path contains a wildcard does not use Bloom filter' '
+test_expect_success 'git log with paths all contain non-wildcard part uses Bloom filter' '
+ test_bloom_filters_used "-- A/\* file4" &&
+ test_bloom_filters_used "-- A/file\*" &&
+ test_bloom_filters_used "-- * A/\*"
+'
+
+test_expect_success 'git log with path only contains wildcard part does not use Bloom filter' '
test_bloom_filters_not_used "-- file\*" &&
- test_bloom_filters_not_used "-- A/\* file4" &&
- test_bloom_filters_not_used "-- file4 A/\*" &&
- test_bloom_filters_not_used "-- * A/\*"
+ test_bloom_filters_not_used "-- file\* A/\*" &&
+ test_bloom_filters_not_used "-- file\* *" &&
+ test_bloom_filters_not_used "-- \*"
+'
+
+test_expect_success 'git log with path contains various magic signatures' '
+ cd A &&
+ test_bloom_filters_used "-- \:\(top\)B" &&
+ cd .. &&
+
+ test_bloom_filters_used "-- \:\(glob\)A/\*\*/C" &&
+ test_bloom_filters_not_used "-- \:\(icase\)FILE4" &&
+ test_bloom_filters_not_used "-- \:\(exclude\)A/B/C" &&
+
+ test_when_finished "rm -f .gitattributes" &&
+ cat >.gitattributes <<-EOF &&
+ A/file1 text
+ A/B/file2 -text
+ EOF
+ test_bloom_filters_used "-- \:\(attr\:text\)A"
'
test_expect_success 'setup - add commit-graph to the chain without Bloom filters' '