mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-11 23:37:38 +00:00
backport git_oid__cpy_prefix
This commit is contained in:
parent
faf823dcca
commit
fa4b93a61c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user