summaryrefslogtreecommitdiff
path: root/builtin/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-08-25 14:22:03 -0700
committerJunio C Hamano <gitster@pobox.com>2025-08-25 14:22:03 -0700
commiteed447dd959bd99a24c43688b7f6f14f727b550b (patch)
tree190b5a331ba5304f6b182f7974ecd3a09cafcb21 /builtin/commit-graph.c
parent4f58f6d617fd552b03af0bb3a03a90a4dad16e44 (diff)
parent7be9e410b22b3544e01d32f7bef8e6aa9516e152 (diff)
Merge branch 'ps/commit-graph-wo-globals'
Remove dependency on the_repository and other globals from the commit-graph code, and other changes unrelated to de-globaling. * ps/commit-graph-wo-globals: commit-graph: stop passing in redundant repository commit-graph: stop using `the_repository` commit-graph: stop using `the_hash_algo` commit-graph: refactor `parse_commit_graph()` to take a repository commit-graph: store the hash algorithm instead of its length commit-graph: stop using `the_hash_algo` via macros
Diffstat (limited to 'builtin/commit-graph.c')
-rw-r--r--builtin/commit-graph.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 4992ac146e..6656187f90 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -109,7 +109,8 @@ static int graph_verify(int argc, const char **argv, const char *prefix,
opened = OPENED_GRAPH;
else if (errno != ENOENT)
die_errno(_("Could not open commit-graph '%s'"), graph_name);
- else if (open_commit_graph_chain(chain_name, &fd, &st))
+ else if (open_commit_graph_chain(chain_name, &fd, &st,
+ the_repository->hash_algo))
opened = OPENED_CHAIN;
else if (errno != ENOENT)
die_errno(_("could not open commit-graph chain '%s'"), chain_name);
@@ -121,15 +122,15 @@ static int graph_verify(int argc, const char **argv, const char *prefix,
if (opened == OPENED_NONE)
return 0;
else if (opened == OPENED_GRAPH)
- graph = load_commit_graph_one_fd_st(the_repository, fd, &st, source);
+ graph = load_commit_graph_one_fd_st(source, fd, &st);
else
- graph = load_commit_graph_chain_fd_st(the_repository, fd, &st,
+ graph = load_commit_graph_chain_fd_st(the_repository->objects, fd, &st,
&incomplete_chain);
if (!graph)
return 1;
- ret = verify_commit_graph(the_repository, graph, flags);
+ ret = verify_commit_graph(graph, flags);
free_commit_graph(graph);
if (incomplete_chain) {