summaryrefslogtreecommitdiff
path: root/include/git2/tree.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2012-08-06 12:41:08 +0200
committerVicent Marti <tanoku@gmail.com>2012-08-06 12:41:08 +0200
commit51e1d8084641bd36416bf6f127b31d47d64cce69 (patch)
tree1a95e6b4c664020eb4bbff843eead794f3ee3d35 /include/git2/tree.h
parent7e9f78b5fee2d8f56711a587c35fcba10d370547 (diff)
parentb0d376695e7d3f71fed97d9d08b60661faad7a5a (diff)
downloadlibgit2-51e1d8084641bd36416bf6f127b31d47d64cce69.tar.gz
Merge remote-tracking branch 'arrbee/tree-walk-fixes' into development
Conflicts: src/notes.c src/transports/git.c src/transports/http.c src/transports/local.c tests-clar/odb/foreach.c
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r--include/git2/tree.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h
index 014097b12..b91340624 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -129,6 +129,17 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(git_tree *tree, const c
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, size_t idx);
/**
+ * Lookup a tree entry by SHA value.
+ *
+ * Warning: this must examine every entry in the tree, so it is not fast.
+ *
+ * @param tree a previously loaded tree.
+ * @param oid the sha being looked for
+ * @return the tree entry; NULL if not found
+ */
+GIT_EXTERN(const git_tree_entry *) git_tree_entry_byoid(git_tree *tree, const git_oid *oid);
+
+/**
* Get the UNIX file attributes of a tree entry
*
* @param entry a tree entry