diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-05-05 14:22:53 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-05-05 14:22:53 -0700 |
commit | 48ecd122ea6fb8cf12fb4029974c314e5d9efb62 (patch) | |
tree | 88f90fa8c9d903f072a2b1c647c51a9899e520c7 /include/git2/refs.h | |
parent | 2218fd57a50ceb851cb131939bf0747e072e40f6 (diff) | |
parent | 4ef14af93517b3842bc0dfa24147cf10dd029582 (diff) | |
download | libgit2-48ecd122ea6fb8cf12fb4029974c314e5d9efb62.tar.gz |
Merge pull request #659 from libgit2/development-merge
New-error-handling
Diffstat (limited to 'include/git2/refs.h')
-rw-r--r-- | include/git2/refs.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h index 5395ded4b..2073aabc5 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -33,6 +33,17 @@ GIT_BEGIN_DECL GIT_EXTERN(int) git_reference_lookup(git_reference **reference_out, git_repository *repo, const char *name); /** + * Lookup a reference by name and resolve immediately to OID. + * + * @param oid Pointer to oid to be filled in + * @param repo The repository in which to look up the reference + * @param name The long name for the reference + * @return 0 on success, -1 if name could not be resolved + */ +GIT_EXTERN(int) git_reference_name_to_oid( + git_oid *out, git_repository *repo, const char *name); + +/** * Create a new symbolic reference. * * The reference will be created in the repository and written @@ -304,6 +315,15 @@ GIT_EXTERN(int) git_reference_reload(git_reference *ref); */ GIT_EXTERN(void) git_reference_free(git_reference *ref); +/** + * Compare two references. + * + * @param ref1 The first git_reference + * @param ref2 The second git_reference + * @return GIT_SUCCESS if the same, else a stable but meaningless ordering. + */ +GIT_EXTERN(int) git_reference_cmp(git_reference *ref1, git_reference *ref2); + /** @} */ GIT_END_DECL #endif |