libgit2

git_merge_base

Version:

Find a merge base between two commits

Signature

int git_merge_base(git_oid *out, git_repository *repo, const git_oid *one, const git_oid *two);

Parameters

In
out

the OID of a merge base between 'one' and 'two'

In
repo

the repository where the commits exist

In
one

one of the commits

In
two

the other commit

Returns

int

0 on success, GIT_ENOTFOUND if not found or error code

Versions