Skip to content

Commit 9cc31c2

Browse files
committed
revision: complicated pathspecs disable filters
The changed-path Bloom filters work only when we can compute an explicit Bloom filter key in advance. When a pathspec is given that allows case-insensitive checks or wildcard matching, we must disable the Bloom filter performance checks. By checking the pathspec in prepare_to_use_bloom_filters(), we avoid setting up the Bloom filter data and thus revert to the usual logic. Before this change, the following tests would fail*: t6004-rev-list-path-optim.sh (Tests 6-7) t6130-pathspec-noglob.sh (Tests 3-6) t6131-pathspec-icase.sh (Tests 3-5) *These tests would fail when using GIT_TEST_COMMIT_GRAPH and GIT_TEST_COMMIT_GRAPH_BLOOM_FILTERS except that the latter environment variable was not set up correctly to write the changed- path Bloom filters in the test suite. That will be fixed in the next change. Signed-off-by: Derrick Stolee <[email protected]>
1 parent f4df00a commit 9cc31c2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

revision.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,15 @@ static void prepare_to_use_bloom_filter(struct rev_info *revs)
661661
if (!revs->commits)
662662
return;
663663

664+
if (revs->prune_data.has_wildcard)
665+
return;
666+
if (revs->prune_data.nr > 1)
667+
return;
668+
if (revs->prune_data.magic ||
669+
(revs->prune_data.nr &&
670+
revs->prune_data.items[0].magic))
671+
return;
672+
664673
repo_parse_commit(revs->repo, revs->commits->item);
665674

666675
if (!revs->repo->objects->commit_graph)

0 commit comments

Comments
 (0)