pack-bitmap: make `bitmap_writer_push_bitmapped_commit()` public
The pseudo-merge selection code will be added in a subsequent commit, and will need a way to push the allocated commit structures into the bitmap writer from a separate compilation unit. Make the `bitmap_writer_push_bitmapped_commit()` function part of the pack-bitmap.h header in order to make this possible. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau committed
May 23, 2024 at 17:26 UTC
c059c8795e926cfe3ad8cb7a47f54c071227fcfa
2 files changed
+6
-5
pack-bitmap-write.c
+4
-5
@@ -140,9 +140,8 @@ int bitmap_writer_has_bitmapped_object_id(struct bitmap_writer *writer,
140
* Compute the actual bitmaps
141
*/
142
143
-static inline void push_bitmapped_commit(struct bitmap_writer *writer,
144
- struct commit *commit,
145
- unsigned pseudo_merge)
143
+void bitmap_writer_push_commit(struct bitmap_writer *writer,
144
+ struct commit *commit, unsigned pseudo_merge)
145
{
146
if (writer->selected_nr >= writer->selected_alloc) {
147
writer->selected_alloc = (writer->selected_alloc + 32) * 2;
@@ -664,7 +663,7 @@ void bitmap_writer_select_commits(struct bitmap_writer *writer,
663
664
if (indexed_commits_nr < 100) {
665
for (i = 0; i < indexed_commits_nr; ++i)
667
- push_bitmapped_commit(writer, indexed_commits[i], 0);
666
+ bitmap_writer_push_commit(writer, indexed_commits[i], 0);
667
return;
668
}
669
@@ -697,7 +696,7 @@ void bitmap_writer_select_commits(struct bitmap_writer *writer,
696
}
697
}
698
700
- push_bitmapped_commit(writer, chosen, 0);
699
+ bitmap_writer_push_commit(writer, chosen, 0);
700
701
i += next + 1;
702
display_progress(writer->progress, i);
pack-bitmap.h
+2
@@ -127,6 +127,8 @@ void bitmap_writer_build_type_index(struct bitmap_writer *writer,
127
uint32_t index_nr);
128
int bitmap_writer_has_bitmapped_object_id(struct bitmap_writer *writer,
129
const struct object_id *oid);
130
+void bitmap_writer_push_commit(struct bitmap_writer *writer,
131
+ struct commit *commit, unsigned pseudo_merge);
132
uint32_t *create_bitmap_mapping(struct bitmap_index *bitmap_git,
133
struct packing_data *mapping);
134
int rebuild_bitmap(const uint32_t *reposition,