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

Function add_cache_tree

revision.c:1742–1762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1740}
1741
1742static void add_cache_tree(struct cache_tree *it, struct rev_info *revs,
1743 struct strbuf *path, unsigned int flags)
1744{
1745 size_t baselen = path->len;
1746 int i;
1747
1748 if (it->entry_count >= 0) {
1749 struct tree *tree = lookup_tree(revs->repo, &it->oid);
1750 tree->object.flags |= flags;
1751 add_pending_object_with_path(revs, &tree->object, "",
1752 040000, path->buf);
1753 }
1754
1755 for (i = 0; i < it->subtree_nr; i++) {
1756 struct cache_tree_sub *sub = it->down[i];
1757 strbuf_addf(path, "%s%s", baselen ? "/" : "", sub->name);
1758 add_cache_tree(sub->cache_tree, revs, path, flags);
1759 strbuf_setlen(path, baselen);
1760 }
1761
1762}
1763
1764static void add_resolve_undo_to_pending(struct index_state *istate, struct rev_info *revs)
1765{

Callers 1

Calls 4

lookup_treeFunction · 0.85
strbuf_addfFunction · 0.85
strbuf_setlenFunction · 0.85

Tested by

no test coverage detected