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

Function cache_tree_find

cache-tree.c:675–698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *path)
676{
677 if (!it)
678 return NULL;
679 while (*path) {
680 const char *slash;
681 struct cache_tree_sub *sub;
682
683 slash = strchrnul(path, '/');
684 /*
685 * Between path and slash is the name of the subtree
686 * to look for.
687 */
688 sub = find_subtree(it, path, slash - path, 0);
689 if (!sub)
690 return NULL;
691 it = sub->cache_tree;
692
693 path = slash;
694 while (*path == '/')
695 path++;
696 }
697 return it;
698}
699
700static int write_index_as_tree_internal(struct object_id *oid,
701 struct index_state *index_state,

Calls 1

find_subtreeFunction · 0.85

Tested by

no test coverage detected