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

Function find_cached_object

odb/source-inmemory.c:15–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13};
14
15static 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
36static void populate_object_info(struct odb_source_inmemory *source,
37 struct object_info *oi,

Calls 2

oidtree_getFunction · 0.85
oideqFunction · 0.85

Tested by

no test coverage detected