summaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-03 10:23:34 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-03 10:23:34 -0800
commitb83a2f9006cdf5293370b1254f4f4cb2770c1b9f (patch)
tree5f09867e19b13f6f513b8881fdf5d03f906079b5 /builtin/index-pack.c
parentf49905d47d42cf6ea4c34b5a8301e84149e7aeba (diff)
parent8705c9bd139028aae148251420da27c9bf1c4745 (diff)
Merge branch 'kn/pack-write-with-reduced-globals'
Code clean-up. * kn/pack-write-with-reduced-globals: pack-write: pass hash_algo to internal functions pack-write: pass hash_algo to `write_rev_file()` pack-write: pass hash_algo to `write_idx_file()` pack-write: pass repository to `index_pack_lockfile()` pack-write: pass hash_algo to `fixup_pack_header_footer()`
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 6ffbb7ce35..c2a1750631 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1392,7 +1392,7 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha
strbuf_release(&msg);
finalize_hashfile(f, tail_hash, FSYNC_COMPONENT_PACK, 0);
hashcpy(read_hash, pack_hash, the_repository->hash_algo);
- fixup_pack_header_footer(output_fd, pack_hash,
+ fixup_pack_header_footer(the_hash_algo, output_fd, pack_hash,
curr_pack, nr_objects,
read_hash, consumed_bytes-the_hash_algo->rawsz);
if (!hasheq(read_hash, tail_hash, the_repository->hash_algo))
@@ -2089,11 +2089,12 @@ int cmd_index_pack(int argc,
ALLOC_ARRAY(idx_objects, nr_objects);
for (i = 0; i < nr_objects; i++)
idx_objects[i] = &objects[i].idx;
- curr_index = write_idx_file(index_name, idx_objects, nr_objects, &opts, pack_hash);
+ curr_index = write_idx_file(the_hash_algo, index_name, idx_objects,
+ nr_objects, &opts, pack_hash);
if (rev_index)
- curr_rev_index = write_rev_file(rev_index_name, idx_objects,
- nr_objects, pack_hash,
- opts.flags);
+ curr_rev_index = write_rev_file(the_hash_algo, rev_index_name,
+ idx_objects, nr_objects,
+ pack_hash, opts.flags);
free(idx_objects);
if (!verify)