libgit2

git_diff_merge

Version:

Merge one diff into another.

This merges items from the "from" list into the "onto" list. The resulting diff will have all items that appear in either list. If an item appears in both lists, then it will be "merged" to appear as if the old version was from the "onto" list and the new version is from the "from" list (with the exception that if the item has a pending DELETE in the middle, then it will show as deleted).

Signature

int git_diff_merge(git_diff *onto, const git_diff *from);

Parameters

In
onto

Diff to merge into.

In
from

Diff to merge.

Returns

int

0 or an error code.

Versions