diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-10-12 14:06:23 +0200 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2011-10-13 23:15:11 +0200 |
commit | 34aff0100248dbf349240fd8edff4cc440062b40 (patch) | |
tree | 7b65cac1a879ebd021d39564a15ee23bb3f29bf8 /include/git2/oid.h | |
parent | a6c0e4d2028966c73525de020d4e500f272dfadf (diff) | |
download | libgit2-34aff0100248dbf349240fd8edff4cc440062b40.tar.gz |
oid: Add git_oid_streq() which checks if an oid and an hex formatted string are equal
Diffstat (limited to 'include/git2/oid.h')
-rw-r--r-- | include/git2/oid.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/oid.h b/include/git2/oid.h index f9636d1f..b9824b88 100644 --- a/include/git2/oid.h +++ b/include/git2/oid.h @@ -150,6 +150,16 @@ GIT_EXTERN(int) git_oid_cmp(const git_oid *a, const git_oid *b); GIT_EXTERN(int) git_oid_ncmp(const git_oid *a, const git_oid *b, unsigned int len); /** + * Check if an oid equals an hex formatted object id. + * + * @param a oid structure. + * @param str input hex string of an object id. + * @return GIT_ENOTOID if str is not a valid hex string, + * GIT_SUCCESS in case of a match, GIT_ERROR otherwise. + */ +GIT_EXTERN(int) git_oid_streq(const git_oid *a, const char *str); + +/** * OID Shortener object */ typedef struct git_oid_shorten git_oid_shorten; |