libgit2

git_oid_fromstrn

Version:

Parse N characters of a hex formatted object id into a git_oid

If N is odd, N-1 characters will be parsed instead. The remaining space in the git_oid will be set to zero.

Signature

int git_oid_fromstrn(git_oid *out, const char *str, size_t length);

Parameters

In
out

oid structure the result is written into.

const char *
In
str

input hex string of at least size length

size_t
In
length

length of the input string

Returns

int

GIT_SUCCESS or an error code

Versions