summaryrefslogtreecommitdiff
path: root/include/git2/object.h
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-09-16 16:20:38 -0700
committerBen Straub <bs@github.com>2013-09-16 16:23:50 -0700
commitceab4e260637dc8374d0348ee9a078ab1c16e4ad (patch)
tree25124d6ea0528f5f3355046f56aaac43ba78ec4d /include/git2/object.h
parent549931679a77b280eb1f36afeda8930eb31d70f7 (diff)
downloadlibgit2-ceab4e260637dc8374d0348ee9a078ab1c16e4ad.tar.gz
Port blame from git.git
Diffstat (limited to 'include/git2/object.h')
-rw-r--r--include/git2/object.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/git2/object.h b/include/git2/object.h
index f74f3dfd1..7ec17cd8e 100644
--- a/include/git2/object.h
+++ b/include/git2/object.h
@@ -36,7 +36,7 @@ GIT_BEGIN_DECL
* @param repo the repository to look up the object
* @param id the unique identifier for the object
* @param type the type of the object
- * @return 0 or an error code
+ * @return a reference to the object
*/
GIT_EXTERN(int) git_object_lookup(
git_object **object,
@@ -78,6 +78,23 @@ GIT_EXTERN(int) git_object_lookup_prefix(
size_t len,
git_otype type);
+
+/**
+ * Lookup an object that represents a tree entry.
+ *
+ * @param out buffer that receives a pointer to the object (which must be freed
+ * by the caller)
+ * @param treeish root object that can be peeled to a tree
+ * @param path relative path from the root object to the desired object
+ * @param type type of object desired
+ * @return 0 on success, or an error code
+ */
+GIT_EXTERN(int) git_object_lookup_bypath(
+ git_object **out,
+ const git_object *treeish,
+ const char *path,
+ git_otype type);
+
/**
* Get the id (SHA1) of a repository object
*