I'll try to merge a branch to another but I've a MergeConflictException all time. So I try to stage all repository.Index.Conflicts but without any change.
string[] conflictArray = new string[10000];
try {
repository.Merge(branch[selected], GitHelper.getSignature(), options);
} catch(MergeConflictException e) {
if (repository.Index.Conflicts.Count() > 0) {
foreach (var c in repository.Index.Conflicts) {
repository.Index.Stage(c.Theirs.Path);
}
}
}
I' search a lot to have any help, I read MergeFixture.cs from LibGit2Sharp.Tests.
EDIT: sorry I don't tell you why i'm working on this but I'm student and my teachers gave to me this project to do with .NET 3.5 so I use latest 3.5 release of LibGit2Sharp.