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

Function get_tree_entry

tree-walk.c:605–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605int get_tree_entry(struct repository *r,
606 const struct object_id *tree_oid,
607 const char *name,
608 struct object_id *oid,
609 unsigned short *mode)
610{
611 int retval;
612 void *tree;
613 size_t size;
614 struct object_id root;
615
616 tree = odb_read_object_peeled(r->objects, tree_oid, OBJ_TREE, &size, &root);
617 if (!tree)
618 return -1;
619
620 if (name[0] == '\0') {
621 oidcpy(oid, &root);
622 free(tree);
623 return 0;
624 }
625
626 if (!size) {
627 retval = -1;
628 } else {
629 struct tree_desc t;
630 init_tree_desc(&t, tree_oid, tree, size);
631 retval = find_tree_entry(r, &t, name, oid, mode);
632 }
633 free(tree);
634 return retval;
635}
636
637/*
638 * This is Linux's built-in max for the number of symlinks to follow.

Callers 12

fill_blob_sha1Function · 0.85
find_tree_entryFunction · 0.85
init_notesFunction · 0.85
verify_working_tree_pathFunction · 0.85
fill_blob_sha1_and_modeFunction · 0.85
shift_treeFunction · 0.85
shift_tree_byFunction · 0.85
get_oid_with_context_1Function · 0.85
read_attr_from_blobFunction · 0.85
read_one_entFunction · 0.85
check_local_modFunction · 0.85

Calls 4

odb_read_object_peeledFunction · 0.85
oidcpyFunction · 0.85
init_tree_descFunction · 0.85
find_tree_entryFunction · 0.85

Tested by

no test coverage detected