PatchListLoader: Use equals instead of == for comparison

In this case there is not actually a bug, because it's comparing two
RevCommit objects from the same RevWalk, which by design uses the same
instance every time a particular SHA-1 is referenced. However, this is
not obvious to reason about.

Change-Id: I19df77c04a661e5fcb2b0e021ceccfeac2d43673
This commit is contained in:
Dave Borowitz
2016-07-20 12:29:30 -04:00
parent c67c17fe9c
commit 804d4b587a

View File

@@ -151,7 +151,7 @@ public class PatchListLoader implements Callable<PatchList> {
}
final boolean againstParent =
b.getParentCount() > 0 && b.getParent(0) == a;
b.getParentCount() > 0 && b.getParent(0).equals(a);
RevCommit aCommit = a instanceof RevCommit ? (RevCommit) a : null;
RevTree aTree = rw.parseTree(a);