summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-07-27 09:16:52 -0700
committerJunio C Hamano <gitster@pobox.com>2022-07-27 09:16:52 -0700
commit36d7bd19cfe14f7f7ab546764c3879e037573069 (patch)
treee7cb91faa66e43d09b1a20070f04bd7b67c761b8 /commit-graph.c
parent6a475b71f8c4ce708d69fdc9317aefbde3769e25 (diff)
parenta92d8523cef66d46e24cd5ef2f01ef97dc4ab239 (diff)
downloadgit-36d7bd19cfe14f7f7ab546764c3879e037573069.tar.gz
Merge branch 'js/commit-graph-parsing-without-repo-settings'
API tweak to make it easier to run fuzz testing on commit-graph parser. * js/commit-graph-parsing-without-repo-settings: commit-graph: pass repo_settings instead of repository
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 2b04ef072d..cc3c966596 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -252,7 +252,8 @@ struct commit_graph *load_commit_graph_one_fd_st(struct repository *r,
}
graph_map = xmmap(NULL, graph_size, PROT_READ, MAP_PRIVATE, fd, 0);
close(fd);
- ret = parse_commit_graph(r, graph_map, graph_size);
+ prepare_repo_settings(r);
+ ret = parse_commit_graph(&r->settings, graph_map, graph_size);
if (ret)
ret->odb = odb;
@@ -321,7 +322,7 @@ static int graph_read_bloom_data(const unsigned char *chunk_start,
return 0;
}
-struct commit_graph *parse_commit_graph(struct repository *r,
+struct commit_graph *parse_commit_graph(struct repo_settings *s,
void *graph_map, size_t graph_size)
{
const unsigned char *data;
@@ -359,8 +360,6 @@ struct commit_graph *parse_commit_graph(struct repository *r,
return NULL;
}
- prepare_repo_settings(r);
-
graph = alloc_commit_graph();
graph->hash_len = the_hash_algo->rawsz;
@@ -390,7 +389,7 @@ struct commit_graph *parse_commit_graph(struct repository *r,
pair_chunk(cf, GRAPH_CHUNKID_EXTRAEDGES, &graph->chunk_extra_edges);
pair_chunk(cf, GRAPH_CHUNKID_BASE, &graph->chunk_base_graphs);
- if (get_configured_generation_version(r) >= 2) {
+ if (s->commit_graph_generation_version >= 2) {
pair_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA,
&graph->chunk_generation_data);
pair_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA_OVERFLOW,
@@ -400,7 +399,7 @@ struct commit_graph *parse_commit_graph(struct repository *r,
graph->read_generation_data = 1;
}
- if (r->settings.commit_graph_read_changed_paths) {
+ if (s->commit_graph_read_changed_paths) {
pair_chunk(cf, GRAPH_CHUNKID_BLOOMINDEXES,
&graph->chunk_bloom_indexes);
read_chunk(cf, GRAPH_CHUNKID_BLOOMDATA,