Commit fa4b93a6 by Edward Thomson

backport git_oid__cpy_prefix

parent faf823dc
...@@ -44,4 +44,13 @@ GIT_INLINE(int) git_oid__cmp(const git_oid *a, const git_oid *b) ...@@ -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); 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 #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment