summaryrefslogtreecommitdiff
path: root/src/cache.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 /src/cache.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 'src/cache.h')
-rw-r--r--src/cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cache.h b/src/cache.h
index 4794dea3a..3038030f4 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -42,6 +42,11 @@ GIT_INLINE(int) git_cached_obj_compare(git_cached_obj *obj, const git_oid *oid)
return git_oid_cmp(&obj->oid, oid);
}
+GIT_INLINE(int) git_cached_obj_match(unsigned int len, git_cached_obj *obj, const git_oid *oid)
+{
+ return git_oid_match(len, &obj->oid, oid);
+}
+
GIT_INLINE(void) git_cached_obj_incref(git_cached_obj *obj)
{
git_atomic_inc(&obj->refcount);