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

Function add_preferred_base_object

builtin/pack-objects.c:2103–2124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2101}
2102
2103static void add_preferred_base_object(const char *name)
2104{
2105 struct pbase_tree *it;
2106 size_t cmplen;
2107 unsigned hash = pack_name_hash_fn(name);
2108
2109 if (!num_preferred_base || check_pbase_path(hash))
2110 return;
2111
2112 cmplen = name_cmp_len(name);
2113 for (it = pbase_tree; it; it = it->next) {
2114 if (cmplen == 0) {
2115 add_object_entry(&it->pcache.oid, OBJ_TREE, NULL, 1);
2116 }
2117 else {
2118 struct tree_desc tree;
2119 init_tree_desc(&tree, &it->pcache.oid,
2120 it->pcache.tree_data, it->pcache.tree_size);
2121 add_pbase_object(&tree, name, cmplen, name);
2122 }
2123 }
2124}
2125
2126static void add_preferred_base(struct object_id *oid)
2127{

Callers 2

show_objectFunction · 0.85

Calls 6

pack_name_hash_fnFunction · 0.85
check_pbase_pathFunction · 0.85
name_cmp_lenFunction · 0.85
add_object_entryFunction · 0.85
init_tree_descFunction · 0.85
add_pbase_objectFunction · 0.85

Tested by

no test coverage detected