[error prone] fix ReferenceEquality warning in RevWalk#isMergedInto

Change-Id: Ibef75e2bc76e90f6e29c4cb3ba1c1f6e67009b10
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2019-08-09 01:06:13 +02:00
parent 722deaa671
commit 70258a9cb2
1 changed files with 5 additions and 2 deletions

View File

@ -72,6 +72,7 @@
import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.filter.RevFilter; import org.eclipse.jgit.revwalk.filter.RevFilter;
import org.eclipse.jgit.treewalk.filter.TreeFilter; import org.eclipse.jgit.treewalk.filter.TreeFilter;
import org.eclipse.jgit.util.References;
/** /**
* Walks a commit graph and produces the matching commits in order. * Walks a commit graph and produces the matching commits in order.
@ -433,9 +434,11 @@ public boolean isMergedInto(RevCommit base, RevCommit tip)
markStart(tip); markStart(tip);
markStart(base); markStart(base);
RevCommit mergeBase; RevCommit mergeBase;
while ((mergeBase = next()) != null) while ((mergeBase = next()) != null) {
if (mergeBase == base) if (References.isSameObject(mergeBase, base)) {
return true; return true;
}
}
return false; return false;
} finally { } finally {
filter = oldRF; filter = oldRF;