Skip to content

Commit

Permalink
Make user of early-stop in CanMergeWithoutConflict
Browse files Browse the repository at this point in the history
This stops at the first error so we can return negatives quicker.
  • Loading branch information
carlosmn committed Dec 14, 2015
1 parent 6d14e31 commit 092339c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion LibGit2Sharp/ObjectDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,13 @@ public virtual bool CanMergeWithoutConflict(Commit one, Commit another)
Ensure.ArgumentNotNull(one, "one");
Ensure.ArgumentNotNull(another, "another");

var result = repo.ObjectDatabase.MergeCommits(one, another, null);
var opts = new MergeTreeOptions()
{
SkipReuc = true,
FailOnConflict = true,
};

var result = repo.ObjectDatabase.MergeCommits(one, another, opts);
return (result.Status == MergeTreeStatus.Succeeded);
}

Expand Down

0 comments on commit 092339c

Please sign in to comment.