diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-07-30 13:20:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-07-30 13:20:31 -0700 |
commit | 70cdbbe3a7028b9c1eb7542a0aa038b971d3fb27 (patch) | |
tree | 0bf9a4f33ed2d2bb1c21f11227ffdfa0212c8716 /bloom.c | |
parent | de6dda0dc3d95cd9aaf43a7b85ceeb57316dcc27 (diff) | |
parent | c525ce95b46b34f344c360dbef036cec3ea08e53 (diff) | |
download | git-70cdbbe3a7028b9c1eb7542a0aa038b971d3fb27.tar.gz |
Merge branch 'ds/commit-graph-bloom-updates' into master
Updates to the changed-paths bloom filter.
* ds/commit-graph-bloom-updates:
commit-graph: check all leading directories in changed path Bloom filters
revision: empty pathspecs should not use Bloom filters
revision.c: fix whitespace
commit-graph: check chunk sizes after writing
commit-graph: simplify chunk writes into loop
commit-graph: unify the signatures of all write_graph_chunk_*() functions
commit-graph: persist existence of changed-paths
bloom: fix logic in get_bloom_filter()
commit-graph: change test to die on parse, not load
commit-graph: place bloom_settings in context
Diffstat (limited to 'bloom.c')
-rw-r--r-- | bloom.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -187,7 +187,7 @@ struct bloom_filter *get_bloom_filter(struct repository *r, struct diff_options diffopt; int max_changes = 512; - if (bloom_filters.slab_size == 0) + if (!bloom_filters.slab_size) return NULL; filter = bloom_filter_slab_at(&bloom_filters, c); @@ -195,16 +195,14 @@ struct bloom_filter *get_bloom_filter(struct repository *r, if (!filter->data) { load_commit_graph_info(r, c); if (commit_graph_position(c) != COMMIT_NOT_FROM_GRAPH && - r->objects->commit_graph->chunk_bloom_indexes) { - if (load_bloom_filter_from_graph(r->objects->commit_graph, filter, c)) - return filter; - else - return NULL; - } + r->objects->commit_graph->chunk_bloom_indexes) + load_bloom_filter_from_graph(r->objects->commit_graph, filter, c); } - if (filter->data || !compute_if_not_present) + if (filter->data) return filter; + if (!compute_if_not_present) + return NULL; repo_diff_setup(r, &diffopt); diffopt.flags.recursive = 1; |