Adapt to changes in gerrit core
Adapt to change I22a465e4 and pass a DiffOptions.DEFAULTS to
DiffOperations.
This change is a no/op.
Change-Id: I7fdae563d5578bae88edeb5ce584de0e06635790
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidator.java
index 20fa0f8..7e6b9d6 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidator.java
@@ -46,6 +46,7 @@
import com.google.gerrit.server.git.validators.CommitValidationMessage;
import com.google.gerrit.server.patch.DiffNotAvailableException;
import com.google.gerrit.server.patch.DiffOperations;
+import com.google.gerrit.server.patch.DiffOptions;
import com.google.gerrit.server.patch.filediff.FileDiffOutput;
import com.google.gerrit.server.patch.filediff.TaggedEdit;
import com.google.gerrit.server.project.NoSuchProjectException;
@@ -229,7 +230,8 @@
checkCommitMessageForBlockedKeywords(blockedKeywordPatterns, messages, c.getFullMessage());
Map<String, ObjectId> content = CommitUtils.getChangedContent(repo, c, revWalk);
Map<String, FileDiffOutput> fileDiffs =
- diffOperations.listModifiedFilesAgainstParent(project, c, /* parentNum = */ 0);
+ diffOperations.listModifiedFilesAgainstParent(
+ project, c, /* parentNum = */ 0, DiffOptions.DEFAULTS);
for (String path : content.keySet()) {
ObjectLoader ol = revWalk.getObjectReader().open(content.get(path));
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidatorTest.java
index 96d7e90..6de639d 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidatorTest.java
@@ -29,6 +29,7 @@
import com.google.gerrit.entities.Project;
import com.google.gerrit.server.git.validators.CommitValidationMessage;
import com.google.gerrit.server.patch.DiffOperations;
+import com.google.gerrit.server.patch.DiffOptions;
import com.google.gerrit.server.patch.filediff.Edit;
import com.google.gerrit.server.patch.filediff.FileDiffOutput;
import com.google.gerrit.server.patch.filediff.TaggedEdit;
@@ -84,7 +85,7 @@
DiffOperations diffOperationsMock = mock(DiffOperations.class);
Map<String, FileDiffOutput> mockDiffs = mock(Map.class);
when(diffOperationsMock.listModifiedFilesAgainstParent(
- any(Project.NameKey.class), any(), anyInt()))
+ any(Project.NameKey.class), any(), anyInt(), any(DiffOptions.class)))
.thenReturn(mockDiffs);
for (Map.Entry<String, String> fileContent : FILE_CONTENTS.entrySet()) {
FileDiffOutput file = mock(FileDiffOutput.class);