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

Function pack_pos_to_offset

pack-revindex.c:473–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473off_t pack_pos_to_offset(struct packed_git *p, uint32_t pos)
474{
475 if (!(p->revindex || p->revindex_data))
476 BUG("pack_pos_to_index: reverse index not yet loaded");
477 if (p->num_objects < pos)
478 BUG("pack_pos_to_offset: out-of-bounds object at %"PRIu32, pos);
479
480 if (p->revindex)
481 return p->revindex[pos].offset;
482 else if (pos == p->num_objects)
483 return p->pack_size - p->repo->hash_algo->rawsz;
484 else
485 return nth_packed_object_offset(p, pack_pos_to_index(p, pos));
486}
487
488uint32_t pack_pos_to_midx(struct multi_pack_index *m, uint32_t pos)
489{

Callers 10

show_objects_for_typeFunction · 0.85
get_size_by_posFunction · 0.85
get_disk_usage_for_typeFunction · 0.85
unpack_entryFunction · 0.85
offset_to_pack_posFunction · 0.85
write_reuse_objectFunction · 0.85
write_reused_pack_oneFunction · 0.85

Calls 2

nth_packed_object_offsetFunction · 0.85
pack_pos_to_indexFunction · 0.85

Tested by

no test coverage detected