diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-08-03 13:36:08 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-08-03 13:36:08 -0700 |
| commit | 37e4bdd5ee5d6a7e09feaf5857299aac8fd56aeb (patch) | |
| tree | 68792e9cddee8c9d9a738e2547546c7a311aa4ce /bloom.c | |
| parent | Merge branch 'tk/untracked-cache-with-uall' (diff) | |
| parent | commit-graph: fix corrupt upgrade from generation v1 to v2 (diff) | |
| download | git-37e4bdd5ee5d6a7e09feaf5857299aac8fd56aeb.tar.gz git-37e4bdd5ee5d6a7e09feaf5857299aac8fd56aeb.zip | |
Merge branch 'tb/commit-graph-genv2-upgrade-fix'
There was a bug in the codepath to upgrade generation information
in commit-graph from v1 to v2 format, which has been corrected.
* tb/commit-graph-genv2-upgrade-fix:
commit-graph: fix corrupt upgrade from generation v1 to v2
commit-graph: introduce `repo_find_commit_pos_in_graph()`
t5318: demonstrate commit-graph generation v2 corruption
Diffstat (limited to 'bloom.c')
| -rw-r--r-- | bloom.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -30,10 +30,9 @@ static inline unsigned char get_bitmask(uint32_t pos) static int load_bloom_filter_from_graph(struct commit_graph *g, struct bloom_filter *filter, - struct commit *c) + uint32_t graph_pos) { uint32_t lex_pos, start_index, end_index; - uint32_t graph_pos = commit_graph_position(c); while (graph_pos < g->num_commits_in_base) g = g->base_graph; @@ -203,9 +202,10 @@ struct bloom_filter *get_or_compute_bloom_filter(struct repository *r, filter = bloom_filter_slab_at(&bloom_filters, c); if (!filter->data) { - load_commit_graph_info(r, c); - if (commit_graph_position(c) != COMMIT_NOT_FROM_GRAPH) - load_bloom_filter_from_graph(r->objects->commit_graph, filter, c); + uint32_t graph_pos; + if (repo_find_commit_pos_in_graph(r, c, &graph_pos)) + load_bloom_filter_from_graph(r->objects->commit_graph, + filter, graph_pos); } if (filter->data && filter->len) |
