mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 21:34:15 +00:00
Introduce git_oid_compare, an exported oid cmp
This commit is contained in:
parent
0f85c20840
commit
0c72248b91
@ -138,6 +138,15 @@ GIT_EXTERN(char *) git_oid_tostr(char *out, size_t n, const git_oid *id);
|
||||
*/
|
||||
GIT_EXTERN(void) git_oid_cpy(git_oid *out, const git_oid *src);
|
||||
|
||||
/**
|
||||
* Compare two oid structures.
|
||||
*
|
||||
* @param a first oid structure.
|
||||
* @param b second oid structure.
|
||||
* @return <0, 0, >0 if a < b, a == b, a > b.
|
||||
*/
|
||||
GIT_EXTERN(int) git_oid_compare(const git_oid *oid_a, const git_oid *oid_b);
|
||||
|
||||
/**
|
||||
* Compare two oid structures.
|
||||
*
|
||||
|
@ -166,6 +166,11 @@ void git_oid_cpy(git_oid *out, const git_oid *src)
|
||||
memcpy(out->id, src->id, sizeof(out->id));
|
||||
}
|
||||
|
||||
int git_oid_compare(const git_oid *oid_a, const git_oid *oid_b)
|
||||
{
|
||||
return git_oid_cmp(oid_a, oid_b);
|
||||
}
|
||||
|
||||
int git_oid_ncmp(const git_oid *oid_a, const git_oid *oid_b, size_t len)
|
||||
{
|
||||
const unsigned char *a = oid_a->id;
|
||||
|
Loading…
Reference in New Issue
Block a user