libgit2

git_oid_from_raw

Version:

Parse a raw object id into a git_oid.

The appropriate number of bytes for the given object ID type will be read from the byte array - 20 bytes for SHA1, 32 bytes for SHA256.

Signature

int git_oid_from_raw(git_oid *out, const unsigned char *raw, git_oid_t type);

Parameters

In
out

oid structure the result is written into.

const unsigned char *
In
raw

raw object ID bytes

In
type

object id type

Returns

int

0 or an error code

Versions