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

Function oe_map_new_pack

pack-objects.c:119–132  ·  view source on GitHub ↗

* A new pack appears after prepare_in_pack_by_idx() has been * run. This is likely a race. * * We could map this new pack to in_pack_by_idx[] array, but then we * have to deal with full array anyway. And since it's hard to test * this fall back code, just stay simple and fall back to using * in_pack[] array. */

Source from the content-addressed store, hash-verified

117 * in_pack[] array.
118 */
119void oe_map_new_pack(struct packing_data *pack)
120{
121 uint32_t i;
122
123 if (pack->in_pack)
124 BUG("packing_data has already been converted to pack array");
125
126 ALLOC_ARRAY(pack->in_pack, pack->nr_alloc);
127
128 for (i = 0; i < pack->nr_objects; i++)
129 pack->in_pack[i] = oe_in_pack(pack, pack->objects + i);
130
131 FREE_AND_NULL(pack->in_pack_by_idx);
132}
133
134/* assume pdata is already zero'd by caller */
135void prepare_packing_data(struct repository *r, struct packing_data *pdata)

Callers 1

oe_set_in_packFunction · 0.85

Calls 1

oe_in_packFunction · 0.85

Tested by

no test coverage detected