From 4875d998de40d929ab6af8e26a76c9570d84121c Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sat, 8 Apr 2023 21:30:31 +0100 Subject: commit_list: support sha256 --- src/libgit2/commit_list.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libgit2/commit_list.c') diff --git a/src/libgit2/commit_list.c b/src/libgit2/commit_list.c index 12b329b25..485871db3 100644 --- a/src/libgit2/commit_list.c +++ b/src/libgit2/commit_list.c @@ -125,7 +125,7 @@ static int commit_quick_parse( git_oid *parent_oid; git_commit *commit; git_commit__parse_options parse_opts = { - GIT_OID_SHA1, + walk->repo->oid_type, GIT_COMMIT_PARSE_QUICK }; size_t i; @@ -176,7 +176,9 @@ int git_commit_list_parse(git_revwalk *walk, git_commit_list_node *commit) if (cgraph_file) { git_commit_graph_entry e; - error = git_commit_graph_entry_find(&e, cgraph_file, &commit->oid, GIT_OID_SHA1_SIZE); + error = git_commit_graph_entry_find(&e, cgraph_file, + &commit->oid, git_oid_size(walk->repo->oid_type)); + if (error == 0 && git__is_uint16(e.parent_count)) { size_t i; commit->generation = (uint32_t)e.generation; -- cgit v1.2.1