Skip to content

Commit 8a753b9

Browse files
committed
Merge branch 'jh/hash-init-fixes'
An earlier code refactoring of the hash machinery missed a few required calls to init_fn. * jh/hash-init-fixes: index-pack, unpack-objects: restore missing ->init_fn
2 parents 58a8c38 + d39f04b commit 8a753b9

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)