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

Function populate_object_info

odb/source-inmemory.c:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static void populate_object_info(struct odb_source_inmemory *source,
37 struct object_info *oi,
38 const struct inmemory_object *object)
39{
40 if (!oi)
41 return;
42
43 if (oi->typep)
44 *(oi->typep) = object->type;
45 if (oi->sizep)
46 *(oi->sizep) = object->size;
47 if (oi->disk_sizep)
48 *(oi->disk_sizep) = 0;
49 if (oi->delta_base_oid)
50 oidclr(oi->delta_base_oid, source->base.odb->repo->hash_algo);
51 if (oi->contentp)
52 *oi->contentp = xmemdupz(object->buf, object->size);
53 if (oi->mtimep)
54 *oi->mtimep = 0;
55 oi->whence = OI_CACHED;
56}
57
58static int odb_source_inmemory_read_object_info(struct odb_source *source,
59 const struct object_id *oid,

Calls 2

oidclrFunction · 0.85
xmemdupzFunction · 0.85

Tested by

no test coverage detected