MCPcopy Index your code
hub / github.com/git/git / repo_parse_tree_gently

Function repo_parse_tree_gently

tree.c:186–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186int repo_parse_tree_gently(struct repository *r, struct tree *item,
187 int quiet_on_missing)
188{
189 enum object_type type;
190 void *buffer;
191 size_t size;
192
193 if (item->object.parsed)
194 return 0;
195 buffer = odb_read_object(r->objects, &item->object.oid, &type, &size);
196 if (!buffer)
197 return quiet_on_missing ? -1 :
198 error("Could not read %s",
199 oid_to_hex(&item->object.oid));
200 if (type != OBJ_TREE) {
201 free(buffer);
202 return error("Object %s not a tree",
203 oid_to_hex(&item->object.oid));
204 }
205 return parse_tree_buffer(item, buffer, size);
206}
207
208void free_tree_buffer(struct tree *tree)
209{

Callers 5

add_children_by_pathFunction · 0.85
process_treeFunction · 0.85
repo_parse_treeFunction · 0.85
add_tree_entriesFunction · 0.85

Calls 4

odb_read_objectFunction · 0.85
errorFunction · 0.85
oid_to_hexFunction · 0.85
parse_tree_bufferFunction · 0.85

Tested by

no test coverage detected