summaryrefslogtreecommitdiff
path: root/include/git2/blob.h
diff options
context:
space:
mode:
authorMarc Pegon <pegon.marc@gmail.com>2011-06-06 11:55:48 +0200
committerMarc Pegon <pegon.marc@gmail.com>2011-06-06 11:55:48 +0200
commit790c6c95fe12051f7f7b32df5f4fba316872fddb (patch)
tree767946c03fb8a613ed008ec50aff0ccacd69573a /include/git2/blob.h
parentf9213015fddb8636daa993080cbbec70a02cba5c (diff)
downloadlibgit2-790c6c95fe12051f7f7b32df5f4fba316872fddb.tar.gz
Added methods to search objects of different types
given an OID prefix.
Diffstat (limited to 'include/git2/blob.h')
-rw-r--r--include/git2/blob.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h
index 0e05d6f89..e366ce880 100644
--- a/include/git2/blob.h
+++ b/include/git2/blob.h
@@ -53,6 +53,23 @@ GIT_INLINE(int) git_blob_lookup(git_blob **blob, git_repository *repo, const git
}
/**
+ * Lookup a blob object from a repository,
+ * given a prefix of its identifier (short id).
+ *
+ * @see git_object_lookup_prefix
+ *
+ * @param blob pointer to the looked up blob
+ * @param repo the repo to use when locating the blob.
+ * @param id identity of the blob to locate.
+ * @param len the length of the short identifier
+ * @return 0 on success; error code otherwise
+ */
+GIT_INLINE(int) git_blob_lookup_prefix(git_blob **blob, git_repository *repo, const git_oid *id, unsigned int len)
+{
+ return git_object_lookup_prefix((git_object **)blob, repo, id, len, GIT_OBJ_BLOB);
+}
+
+/**
* Close an open blob
*
* This is a wrapper around git_object_close()