MCPcopy Create free account
hub / github.com/git/git / midx_for_object

Function midx_for_object

midx.c:420–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420static 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
437static uint32_t midx_for_pack(struct multi_pack_index **_m,
438 uint32_t pack_int_id)

Callers 4

nth_midxed_object_oidFunction · 0.85
nth_midxed_offsetFunction · 0.85
nth_midxed_pack_int_idFunction · 0.85
fill_midx_entryFunction · 0.85

Calls 1

dieFunction · 0.70

Tested by

no test coverage detected