libgit2

git_tree_entry_bypath

Version:

Retrieve a tree entry contained in a tree or in any of its subtrees, given its relative path.

Unlike the other lookup functions, the returned tree entry is owned by the user and must be freed explicitly with git_tree_entry_free().

Signature

int git_tree_entry_bypath(git_tree_entry **out, const git_tree *root, const char *path);

Parameters

In
out

Pointer where to store the tree entry

In
root

Previously loaded tree which is the root of the relative path

const char *
In
path

Path to the contained entry

Returns

int

0 on success; GIT_ENOTFOUND if the path does not exist

Versions