| 13 | }; |
| 14 | |
| 15 | static const struct inmemory_object *find_cached_object(struct odb_source_inmemory *source, |
| 16 | const struct object_id *oid) |
| 17 | { |
| 18 | static const struct inmemory_object empty_tree = { |
| 19 | .type = OBJ_TREE, |
| 20 | .buf = "", |
| 21 | }; |
| 22 | const struct inmemory_object *object; |
| 23 | |
| 24 | if (source->objects) { |
| 25 | object = oidtree_get(source->objects, oid); |
| 26 | if (object) |
| 27 | return object; |
| 28 | } |
| 29 | |
| 30 | if (oid->algo && oideq(oid, hash_algos[oid->algo].empty_tree)) |
| 31 | return &empty_tree; |
| 32 | |
| 33 | return NULL; |
| 34 | } |
| 35 | |
| 36 | static void populate_object_info(struct odb_source_inmemory *source, |
| 37 | struct object_info *oi, |
no test coverage detected