summaryrefslogtreecommitdiff
path: root/src/libgit2/commit_graph.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-07-08 17:17:09 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2023-02-12 21:26:12 +0000
commit479c8c8c14f83491f31fb9b23388ae17070c9549 (patch)
tree9847977931b5c77325c11cc4ed79163db870fe56 /src/libgit2/commit_graph.c
parente89e2e0102300af1faf0ab892e598a700692718a (diff)
downloadlibgit2-479c8c8c14f83491f31fb9b23388ae17070c9549.tar.gz
packfile: handle sha256 packfiles
Teach the packfile machinery to cope with SHA256.
Diffstat (limited to 'src/libgit2/commit_graph.c')
-rw-r--r--src/libgit2/commit_graph.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libgit2/commit_graph.c b/src/libgit2/commit_graph.c
index 9554fe855..bf557f7ad 100644
--- a/src/libgit2/commit_graph.c
+++ b/src/libgit2/commit_graph.c
@@ -538,7 +538,7 @@ int git_commit_graph_entry_find(
hi = ntohl(file->oid_fanout[(int)short_oid->id[0]]);
lo = ((short_oid->id[0] == 0x0) ? 0 : ntohl(file->oid_fanout[(int)short_oid->id[0] - 1]));
- pos = git_pack__lookup_sha1(file->oid_lookup, GIT_OID_SHA1_SIZE, lo, hi, short_oid->id);
+ pos = git_pack__lookup_id(file->oid_lookup, GIT_OID_SHA1_SIZE, lo, hi, short_oid->id, GIT_OID_SHA1);
if (pos >= 0) {
/* An object matching exactly the oid was found */
@@ -726,7 +726,8 @@ int git_commit_graph_writer_add_index_file(
if (error < 0)
goto cleanup;
- error = git_mwindow_get_pack(&p, idx_path);
+ /* TODO: SHA256 */
+ error = git_mwindow_get_pack(&p, idx_path, 0);
if (error < 0)
goto cleanup;