Stop using JGit's deprecated AnyObjectId.equals method

The equals method was depecated in favor of isEqual in [1] which
is included in JGit since version v5.4.1.201908211225-r.

[1] https://git.eclipse.org/r/#/c/147315/

Change-Id: I5366437a04a75135fcd522e65b80be5a34d7c334
This commit is contained in:
David Pursehouse 2019-09-06 12:09:37 +09:00
parent 6952943620
commit 95c89ec8a0
2 changed files with 5 additions and 5 deletions

View File

@ -371,7 +371,7 @@ public class ChangeEditModifier {
if (optionalChangeEdit.isPresent()) {
ChangeEdit changeEdit = optionalChangeEdit.get();
newTreeId = merge(repository, changeEdit, newTreeId);
if (ObjectId.equals(newTreeId, changeEdit.getEditCommit().getTree())) {
if (ObjectId.isEqual(newTreeId, changeEdit.getEditCommit().getTree())) {
// Modifications are already contained in the change edit.
return changeEdit;
}
@ -474,7 +474,7 @@ public class ChangeEditModifier {
treeCreator.addTreeModifications(treeModifications);
ObjectId newTreeId = treeCreator.createNewTreeAndGetId(repository);
if (ObjectId.equals(newTreeId, baseCommit.getTree())) {
if (ObjectId.isEqual(newTreeId, baseCommit.getTree())) {
throw new InvalidChangeOperationException("no changes were made");
}
return newTreeId;

View File

@ -314,12 +314,12 @@ public class PatchListLoader implements Callable<PatchList> {
}
private static boolean areParentChild(RevCommit commitA, RevCommit commitB) {
return ObjectId.equals(commitA.getParent(0), commitB)
|| ObjectId.equals(commitB.getParent(0), commitA);
return ObjectId.isEqual(commitA.getParent(0), commitB)
|| ObjectId.isEqual(commitB.getParent(0), commitA);
}
private static boolean haveCommonParent(RevCommit commitA, RevCommit commitB) {
return ObjectId.equals(commitA.getParent(0), commitB.getParent(0));
return ObjectId.isEqual(commitA.getParent(0), commitB.getParent(0));
}
private static Set<String> getTouchedFilePaths(PatchListEntry patchListEntry) {