Skip to content

Commit d39f04b

Browse files
Jensen Huanggitster
authored andcommitted
index-pack, unpack-objects: restore missing ->init_fn
Commit 0578f1e ("global: adapt callers to use generic hash context helpers") accidentally removed `->init_fn`, which is required for OpenSSL 3+ SHA1. This fixes the following error on fetch: fatal: fetch-pack: invalid index-pack output Signed-off-by: Jensen Huang <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0578f1e commit d39f04b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

builtin/index-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,7 @@ static void parse_pack_objects(unsigned char *hash)
12861286

12871287
/* Check pack integrity */
12881288
flush();
1289+
the_hash_algo->init_fn(&tmp_ctx);
12891290
git_hash_clone(&tmp_ctx, &input_ctx);
12901291
git_hash_final(hash, &tmp_ctx);
12911292
if (!hasheq(fill(the_hash_algo->rawsz), hash, the_repository->hash_algo))

builtin/unpack-objects.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ int cmd_unpack_objects(int argc,
668668
the_hash_algo->init_fn(&ctx);
669669
unpack_all();
670670
git_hash_update(&ctx, buffer, offset);
671+
the_hash_algo->init_fn(&tmp_ctx);
671672
git_hash_clone(&tmp_ctx, &ctx);
672673
git_hash_final_oid(&oid, &tmp_ctx);
673674
if (strict) {

0 commit comments

Comments
 (0)