libgit2

git_merge_file

Version:

Merge two files as they exist in the in-memory data structures, 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.

Note that this function does not reference a repository and any configuration must be passed as git_merge_file_options.

Signature

int git_merge_file(git_merge_file_result *out, const git_merge_file_input *ancestor, const git_merge_file_input *ours, const git_merge_file_input *theirs, const git_merge_file_options *opts);

Parameters

In
out

The git_merge_file_result to be filled in

In
ancestor

The contents of the ancestor file

In
ours

The contents of the file in "our" side

In
theirs

The contents of the file in "their" side

In
opts

The merge file options or NULL for defaults

Returns

int

0 on success or error code

Versions