| 34 | } |
| 35 | |
| 36 | static 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 | |
| 58 | static int odb_source_inmemory_read_object_info(struct odb_source *source, |
| 59 | const struct object_id *oid, |
no test coverage detected