diff options
Diffstat (limited to 'include')
-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 c35acdcdc..8d93e79cf 100644 --- a/include/git2/oid.h +++ b/include/git2/oid.h @@ -202,6 +202,16 @@ GIT_EXTERN(int) git_oid_ncmp(const git_oid *a, const git_oid *b, size_t len); GIT_EXTERN(int) git_oid_streq(const git_oid *id, const char *str); /** + * Compare an oid to an hex formatted object id. + * + * @param id oid structure. + * @param str input hex string of an object id. + * @return -1 if str is not valid, <0 if id sorts before str, + * 0 if id matches str, >0 if id sorts after str. + */ +GIT_EXTERN(int) git_oid_strcmp(const git_oid *id, const char *str); + +/** * Check is an oid is all zeros. * * @return 1 if all zeros, 0 otherwise. |