Using libgit2sharp I am merging changes from two users:
public void Merge(string branchName)
{
using (Repository repo = new Repository(this._settings.Directory))
{
var branch = repo.Branches[branchName];
MergeOptions opts = new MergeOptions() { FileConflictStrategy = CheckoutFileConflictStrategy.Merge };
repo.Merge(branch, this._signature, opts);
if (repo.Index.Conflicts.Count() > 0)
{
//TODO: resolve conflicts
}
}
}
Even if the strategy is set to merge the conflics still appear. I found no way to resolve the conflict. The Conflict object have no Resolve method.
Is there a way to resolve a conflict from code apart from removing file or renaming it? Is there any auto resolve functionality?
Thank you for any help!