diff options
author | Marc Pegon <pegon.marc@gmail.com> | 2011-06-06 11:55:48 +0200 |
---|---|---|
committer | Marc Pegon <pegon.marc@gmail.com> | 2011-06-06 11:55:48 +0200 |
commit | 790c6c95fe12051f7f7b32df5f4fba316872fddb (patch) | |
tree | 767946c03fb8a613ed008ec50aff0ccacd69573a /include/git2/commit.h | |
parent | f9213015fddb8636daa993080cbbec70a02cba5c (diff) | |
download | libgit2-790c6c95fe12051f7f7b32df5f4fba316872fddb.tar.gz |
Added methods to search objects of different types
given an OID prefix.
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r-- | include/git2/commit.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h index 3687d9460..cf14cd937 100644 --- a/include/git2/commit.h +++ b/include/git2/commit.h @@ -54,6 +54,24 @@ GIT_INLINE(int) git_commit_lookup(git_commit **commit, git_repository *repo, con } /** + * Lookup a commit object from a repository, + * given a prefix of its identifier (short id). + * + * @see git_object_lookup_prefix + * + * @param commit pointer to the looked up commit + * @param repo the repo to use when locating the commit. + * @param id identity of the commit to locate. If the object is + * an annotated tag it will be peeled back to the commit. + * @param len the length of the short identifier + * @return 0 on success; error code otherwise + */ +GIT_INLINE(int) git_commit_lookup_prefix(git_commit **commit, git_repository *repo, const git_oid *id, unsigned len) +{ + return git_object_lookup_prefix((git_object **)commit, repo, id, len, GIT_OBJ_COMMIT); +} + +/** * Close an open commit * * This is a wrapper around git_object_close() |