libgit2

git_tree_entry_byid

Version:

Lookup a tree entry by SHA value.

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

Warning: this must examine every entry in the tree, so it is not fast.

Signature

const git_tree_entry *git_tree_entry_byid(const git_tree *tree, const git_oid *id);

Parameters

In
tree

a previously loaded tree.

In
id

the sha being looked for

Returns

the tree entry; NULL if not found

Versions