]> git.ipfire.org Git - thirdparty/git.git/commit
pack-bitmap: initialize `bitmap_writer_init()` with packing_data
authorTaylor Blau <me@ttaylorr.com>
Thu, 15 Aug 2024 17:31:00 +0000 (13:31 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Aug 2024 18:18:04 +0000 (11:18 -0700)
commit01e9d129396e98b611bff2ae82bb3d610b28c588
tree76e172bdf75254eb7f33181345e9827c779d7224
parent39bf06adf96da25b87c9aa7d35a32ef3683eb4a4
pack-bitmap: initialize `bitmap_writer_init()` with packing_data

In order to determine its object order, the pack-bitmap machinery keeps
a 'struct packing_data' corresponding to the pack or pseudo-pack (when
writing a MIDX bitmap) being written.

The to_pack field is provided to the bitmap machinery by callers of
bitmap_writer_build() and assigned to the bitmap_writer struct at that
point.

But a subsequent commit will want to have access to that data earlier on
during commit selection. Prepare for that by adding a 'to_pack' argument
to 'bitmap_writer_init()', and initializing the field during that
function.

Subsequent commits will clean up other functions which take
now-redundant arguments (like nr_objects, which is equivalent to
pdata->objects_nr, or pdata itself).

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
midx-write.c
pack-bitmap-write.c
pack-bitmap.h