summaryrefslogtreecommitdiff
path: root/include/git2/oid.h
diff options
context:
space:
mode:
authorMarc Pegon <pegon.marc@gmail.com>2011-05-27 22:37:10 +0200
committerVicent Marti <tanoku@gmail.com>2011-06-01 23:40:41 +0200
commit53c0bd81a2915d6f82ef2f9c0703770783a3dc89 (patch)
treee34fd5f5cd97b9738a49588fa889c8ee6819a63a /include/git2/oid.h
parentecd6fdf1f70b785f24e2d17bec516ac88be0cf2c (diff)
downloadlibgit2-53c0bd81a2915d6f82ef2f9c0703770783a3dc89.tar.gz
Added error for ambiguous oid prefixes. Added methods to compare the first nth hexadecimal characters (i.e. packets of 4 bits) of OIDs.
Diffstat (limited to 'include/git2/oid.h')
-rw-r--r--include/git2/oid.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 4538c6147..e8803ced8 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -133,6 +133,16 @@ GIT_EXTERN(void) git_oid_cpy(git_oid *out, const git_oid *src);
GIT_EXTERN(int) git_oid_cmp(const git_oid *a, const git_oid *b);
/**
+ * Compare the first 'len' hexadecimal characters (packets of 4 bits)
+ * of two oid structures.
+ * @param len the number of hex chars to compare
+ * @param a first oid structure.
+ * @param b second oid structure.
+ * @return 1 in case of a match
+ */
+GIT_EXTERN(int) gid_oid_match(unsigned int len, git_oid *a, git_oid *b);
+
+/**
* OID Shortener object
*/
typedef struct git_oid_shorten git_oid_shorten;