libgit2

git_index_conflict_add

Version:

Add or update index entries to represent a conflict. Any staged entries that exist at the given paths will be removed.

The entries are the entries from the tree included in the merge. Any entry may be null to indicate that that file was not present in the trees during the merge. For example, ancestor_entry may be NULL to indicate that a file was added in both branches and must be resolved.

Signature

int git_index_conflict_add(git_index *index, const git_index_entry *ancestor_entry, const git_index_entry *our_entry, const git_index_entry *their_entry);

Parameters

In
index

an existing index object

In
ancestor_entry

the entry data for the ancestor of the conflict

In
our_entry

the entry data for our side of the merge conflict

In
their_entry

the entry data for their side of the merge conflict

Returns

int

0 or an error code

Versions