libgit2

git_graph_descendant_of

Version:

Determine if a commit is the descendant of another commit.

Note that a commit is not considered a descendant of itself, in contrast to git merge-base --is-ancestor.

Signature

int git_graph_descendant_of(git_repository *repo, const git_oid *commit, const git_oid *ancestor);

Parameters

In
repo

the repository where the commits exist

In
commit

a previously loaded commit

In
ancestor

a potential ancestor commit

Returns

int

1 if the given commit is a descendant of the potential ancestor, 0 if not, error code otherwise.

Versions