summaryrefslogtreecommitdiffstats
path: root/pack-bitmap-write.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2024-08-15 19:31:00 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-15 20:18:04 +0200
commit01e9d129396e98b611bff2ae82bb3d610b28c588 (patch)
tree76e172bdf75254eb7f33181345e9827c779d7224 /pack-bitmap-write.c
parentGit 2.46 (diff)
downloadgit-01e9d129396e98b611bff2ae82bb3d610b28c588.tar.xz
git-01e9d129396e98b611bff2ae82bb3d610b28c588.zip
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>
Diffstat (limited to 'pack-bitmap-write.c')
-rw-r--r--pack-bitmap-write.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index bf96c80898..4a7d2d1370 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -41,13 +41,15 @@ static inline int bitmap_writer_nr_selected_commits(struct bitmap_writer *writer
return writer->selected_nr - writer->pseudo_merges_nr;
}
-void bitmap_writer_init(struct bitmap_writer *writer, struct repository *r)
+void bitmap_writer_init(struct bitmap_writer *writer, struct repository *r,
+ struct packing_data *pdata)
{
memset(writer, 0, sizeof(struct bitmap_writer));
if (writer->bitmaps)
BUG("bitmap writer already initialized");
writer->bitmaps = kh_init_oid_map();
writer->pseudo_merge_commits = kh_init_oid_map();
+ writer->to_pack = pdata;
string_list_init_dup(&writer->pseudo_merge_groups);