summaryrefslogtreecommitdiff
path: root/src/oid.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/oid.h')
-rw-r--r--src/oid.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/oid.h b/src/oid.h
index aa1f0bfdc..922a2a347 100644
--- a/src/oid.h
+++ b/src/oid.h
@@ -44,4 +44,13 @@ GIT_INLINE(int) git_oid__cmp(const git_oid *a, const git_oid *b)
return git_oid__hashcmp(a->id, b->id);
}
+GIT_INLINE(void) git_oid__cpy_prefix(
+ git_oid *out, const git_oid *id, size_t len)
+{
+ memcpy(&out->id, id->id, (len + 1) / 2);
+
+ if (len & 1)
+ out->id[len / 2] &= 0xF0;
+}
+
#endif