Skip to content

Commit 092339c

Browse files
committed
Make user of early-stop in CanMergeWithoutConflict
This stops at the first error so we can return negatives quicker.
1 parent 6d14e31 commit 092339c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

LibGit2Sharp/ObjectDatabase.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,13 @@ public virtual bool CanMergeWithoutConflict(Commit one, Commit another)
522522
Ensure.ArgumentNotNull(one, "one");
523523
Ensure.ArgumentNotNull(another, "another");
524524

525-
var result = repo.ObjectDatabase.MergeCommits(one, another, null);
525+
var opts = new MergeTreeOptions()
526+
{
527+
SkipReuc = true,
528+
FailOnConflict = true,
529+
};
530+
531+
var result = repo.ObjectDatabase.MergeCommits(one, another, opts);
526532
return (result.Status == MergeTreeStatus.Succeeded);
527533
}
528534

0 commit comments

Comments
 (0)