libgit2

git_commit_parent

Version:

Get the specified parent of the commit.

Signature

int git_commit_parent(git_commit **parent, git_commit *commit, unsigned int n);

Parameters

In
parent

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 on success; error code otherwise

Versions