libgit2

git_commit_parent

Version:

Get the specified parent of the commit.

Signature

int git_commit_parent(git_commit **out, const git_commit *commit, unsigned int n);

Parameters

In
out

Pointer where to store the parent commit

In
commit

a previously loaded commit.

unsigned int
In
n

the position of the parent (from 0 to parentcount)

Returns

int

0 or an error code

Versions