diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2023-04-22 23:09:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-22 23:09:32 +0100 |
| commit | 8a62616f43fe5ea37d41296f40293ff97aa88cfa (patch) | |
| tree | edb5683195bb8989814ca610e6745745b361efb9 /src/libgit2/commit_list.c | |
| parent | abb0b313172d1b4477fe0c6e88102ce4bb8db90c (diff) | |
| parent | b899fda3d88dc92f50e73544fb7524a1c3c70354 (diff) | |
| download | libgit2-8a62616f43fe5ea37d41296f40293ff97aa88cfa.tar.gz | |
Merge pull request #6549 from libgit2/ethomson/sha256_experimental
sha256: less hardcoded SHA1 types and lengths
Diffstat (limited to 'src/libgit2/commit_list.c')
| -rw-r--r-- | src/libgit2/commit_list.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |
