Aimeast
Aimeast

Reputation: 1663

How convert git_tree_entry to git_tree

Same as title. How convert git_tree_entry to git_tree in libgit2?

if ((error = git_tree_entry_bypath(&source_tree_entry, root_tree, path)) < 0)
    return GIT_ENOTFOUND;

// How convert source_tree_entry to tree here?

entries_count = git_tree_entrycount(tree);

Upvotes: 2

Views: 259

Answers (1)

Carlos Mart&#237;n Nieto
Carlos Mart&#237;n Nieto

Reputation: 5277

You don't convert it, you ask for the tree you want. The tree entry tells you its name, mode and id. If you want that tree, you look it up.

git_tree_lookup(&tree, repo, git_tree_entry_id(tree_entry))

Upvotes: 4

Related Questions