* 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. */
| 117 | * in_pack[] array. |
| 118 | */ |
| 119 | void 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 */ |
| 135 | void prepare_packing_data(struct repository *r, struct packing_data *pdata) |
no test coverage detected