Commit 0b068214 by Edward Thomson

oid: add functions to inspect oid information

Provide helper functions to provide information about the object id size
given its type.
parent 74ffce20
......@@ -14,6 +14,26 @@
extern const git_oid git_oid__empty_blob_sha1;
extern const git_oid git_oid__empty_tree_sha1;
GIT_INLINE(size_t) git_oid_size(git_oid_t type)
{
switch (type) {
case GIT_OID_SHA1:
return GIT_OID_SHA1_SIZE;
}
return 0;
}
GIT_INLINE(size_t) git_oid_hexsize(git_oid_t type)
{
switch (type) {
case GIT_OID_SHA1:
return GIT_OID_SHA1_HEXSIZE;
}
return 0;
}
/**
* Format a git_oid into a newly allocated c-string.
*
......
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