libgit2

git_repository_mergehead_foreach

Version:

If a merge is in progress, invoke 'callback' for each commit ID in the MERGE_HEAD file.

Return a non-zero value from the callback to stop the loop.

Signature

int git_repository_mergehead_foreach(git_repository *repo, git_repository_mergehead_foreach_cb callback, void *payload);

Parameters

In
repo

A repository object

In
callback

Callback function

void *
In
payload

Pointer to callback data (optional)

Returns

int

0 on success, non-zero callback return value, GIT_ENOTFOUND if there is no MERGE_HEAD file, or other error code.

Versions