| 418 | } |
| 419 | |
| 420 | static uint32_t midx_for_object(struct multi_pack_index **_m, uint32_t pos) |
| 421 | { |
| 422 | struct multi_pack_index *m = *_m; |
| 423 | while (m && pos < m->num_objects_in_base) |
| 424 | m = m->base_midx; |
| 425 | |
| 426 | if (!m) |
| 427 | BUG("NULL multi-pack-index for object position: %"PRIu32, pos); |
| 428 | |
| 429 | if (pos >= m->num_objects + m->num_objects_in_base) |
| 430 | die(_("invalid MIDX object position, MIDX is likely corrupt")); |
| 431 | |
| 432 | *_m = m; |
| 433 | |
| 434 | return pos - m->num_objects_in_base; |
| 435 | } |
| 436 | |
| 437 | static uint32_t midx_for_pack(struct multi_pack_index **_m, |
| 438 | uint32_t pack_int_id) |
no test coverage detected