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

Function add_packed_object

t/helper/test-bitmap.c:41–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41static int add_packed_object(const struct object_id *oid,
42 struct packed_git *pack,
43 uint32_t pos,
44 void *_data)
45{
46 struct packing_data *packed = _data;
47 struct object_entry *entry;
48 struct object_info oi = OBJECT_INFO_INIT;
49 enum object_type type;
50
51 oi.typep = &type;
52
53 entry = packlist_alloc(packed, oid);
54 entry->idx.offset = nth_packed_object_offset(pack, pos);
55 if (packed_object_info(pack, entry->idx.offset, &oi) < 0)
56 die("could not get type of object %s",
57 oid_to_hex(oid));
58 oe_set_type(entry, type);
59 oe_set_in_pack(packed, entry, pack);
60
61 return 0;
62}
63
64static int idx_oid_cmp(const void *va, const void *vb)
65{

Callers

nothing calls this directly

Calls 7

packlist_allocFunction · 0.85
nth_packed_object_offsetFunction · 0.85
packed_object_infoFunction · 0.85
oid_to_hexFunction · 0.85
oe_set_typeFunction · 0.85
oe_set_in_packFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected