MergeOp: Use Objects.equals when comparing branch tip

This currently works, because MergeTip doesn't copy or otherwise mess
around with the initial tip object passed in. But MergeTip doesn't
state that in its contract, so this may be a bug waiting to happen.

Change-Id: I61fd71c7f6895d4efb67edbec056b6534b8b94a4
This commit is contained in:
Dave Borowitz
2015-01-29 12:34:38 -08:00
parent c5a971edbe
commit 0a8741d308

View File

@@ -655,7 +655,7 @@ public class MergeOp {
BatchRefUpdate branchUpdate) throws MergeException {
CodeReviewCommit currentTip =
mergeTip != null ? mergeTip.getCurrentTip() : null;
if (branchTip == currentTip) {
if (Objects.equals(branchTip, currentTip)) {
logDebug("Branch already at merge tip {}, no update to perform",
currentTip.name());
return null;