MCPcopy Index your code
hub / github.com/git/git / bitmap_writer_push_commit

Function bitmap_writer_push_commit

pack-bitmap-write.c:190–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188 */
189
190void bitmap_writer_push_commit(struct bitmap_writer *writer,
191 struct commit *commit, unsigned pseudo_merge)
192{
193 if (writer->selected_nr >= writer->selected_alloc) {
194 writer->selected_alloc = (writer->selected_alloc + 32) * 2;
195 REALLOC_ARRAY(writer->selected, writer->selected_alloc);
196 }
197
198 if (!pseudo_merge) {
199 int hash_ret;
200 khiter_t hash_pos = kh_put_oid_map(writer->bitmaps,
201 commit->object.oid,
202 &hash_ret);
203
204 if (!hash_ret)
205 die(_("duplicate entry when writing bitmap index: %s"),
206 oid_to_hex(&commit->object.oid));
207 kh_value(writer->bitmaps, hash_pos) = NULL;
208 }
209
210 writer->selected[writer->selected_nr].commit = commit;
211 writer->selected[writer->selected_nr].bitmap = NULL;
212 writer->selected[writer->selected_nr].write_as = NULL;
213 writer->selected[writer->selected_nr].flags = 0;
214 writer->selected[writer->selected_nr].pseudo_merge = pseudo_merge;
215 writer->selected[writer->selected_nr].pseudo_merge_parents = NULL;
216
217 writer->selected_nr++;
218}
219
220struct bitmap_pos_cache_entry {
221 struct object_id oid;

Callers 3

select_pseudo_merges_1Function · 0.85
bitmap_writeFunction · 0.85

Calls 2

oid_to_hexFunction · 0.85
dieFunction · 0.70

Tested by 1

bitmap_writeFunction · 0.68