last-modified: keep per-path Bloom filters for wildcard pathspecs

The last-modified builtin expands the pathspec to a set of literal paths and builds a Bloom key for each. During the walk it looks those keys up in the commit's filter to decide whether the commit is worth diffing. These lookups need `bloom_filter_settings` for the key hashing. prepare_revision_walk() runs prepare_to_use_bloom_filter() to build the pathspec key vectors. For a pathspec that cannot be turned into a Bloom key, such as a top-level wildcard like "*.c", that function gives up and clears `bloom_filter_settings`. Restore `bloom_filter_settings` after prepare_revision_walk() so the per-path check keeps working for wildcard pathspecs. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Toon Claes committed Jul 17, 2026 at 17:47 UTC 3a60e8d3564a106cd6695afc55a5766d4dfc67b0
1 file changed +8
builtin/last-modified.c
+8
@@ -360,6 +360,14 @@ static int last_modified_run(struct last_modified *lm)
360
361 prepare_revision_walk(&lm->rev);
362
363 + /*
364 + * prepare_revision_walk() clears bloom_filter_settings for pathspecs
365 + * without a Bloom key. Restore it so the per-path check keeps working.
366 + */
367 + if (!lm->rev.bloom_filter_settings)
368 + lm->rev.bloom_filter_settings =
369 + get_bloom_filter_settings(lm->rev.repo);
370 +
371 max_count = lm->rev.max_count;
372
373 init_active_paths_for_commit(&lm->active_paths);