From da03c9f35b282e70f0cb7e6ae1638df476c4e0df Mon Sep 17 00:00:00 2001 From: Marc Pegon Date: Sun, 29 May 2011 11:45:34 +0200 Subject: Changed return value of git_oid_match to be consistent with the other compare methods (0 means oids match). Added method to compare prefixes of hex formatted oids. --- src/oid.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/oid.h') diff --git a/src/oid.h b/src/oid.h index 79f5b6507..1cd2450d6 100644 --- a/src/oid.h +++ b/src/oid.h @@ -1,7 +1,17 @@ #ifndef INCLUDE_oid_h__ #define INCLUDE_oid_h__ -/* This can be useful for internal use */ +/** + * Compare the first ('len'*4) bits of two raw formatted oids. + * This can be useful for internal use. + * Return 0 if they match. + */ int git_oid_match_raw(unsigned int len, const unsigned char *a, const unsigned char *b); +/** + * Compare the first 'len' characters of two hex formatted oids. + * Return 0 if they match. + */ +int git_oid_match_hex(unsigned int len, const unsigned char *a, const unsigned char *b); + #endif -- cgit v1.2.1