libgit2

git_merge_file_from_index

Version:

Merge two files as they exist in the index, using the given common ancestor as the baseline, producing a git_merge_file_result that reflects the merge result. The git_merge_file_result must be freed with git_merge_file_result_free.

Signature

int git_merge_file_from_index(git_merge_file_result *out, git_repository *repo, const git_index_entry *ancestor, const git_index_entry *ours, const git_index_entry *theirs, const git_merge_file_options *opts);

Parameters

In
out

The git_merge_file_result to be filled in

In
repo

The repository

In
ancestor

The index entry for the ancestor file (stage level 1)

In
ours

The index entry for our file (stage level 2)

In
theirs

The index entry for their file (stage level 3)

In
opts

The merge file options or NULL

Returns

int

0 on success or error code

Versions