Merge "Show "+ Unrelated changes" button for delta groups"
diff --git a/java/com/google/gerrit/server/git/receive/ReceiveCommits.java b/java/com/google/gerrit/server/git/receive/ReceiveCommits.java
index 6b7f1f0..9f7b763 100644
--- a/java/com/google/gerrit/server/git/receive/ReceiveCommits.java
+++ b/java/com/google/gerrit/server/git/receive/ReceiveCommits.java
@@ -414,7 +414,6 @@
   private final DynamicSet<PerformanceLogger> performanceLoggers;
   private final PermissionBackend permissionBackend;
   private final ProjectCache projectCache;
-  private final Provider<InternalChangeQuery> queryProvider;
   private final Provider<MergeOp> mergeOpProvider;
   private final Provider<MergeOpRepoManager> ormProvider;
   private final ReceiveConfig receiveConfig;
@@ -505,7 +504,6 @@
       DynamicSet<PerformanceLogger> performanceLoggers,
       PermissionBackend permissionBackend,
       ProjectCache projectCache,
-      Provider<InternalChangeQuery> queryProvider,
       Provider<MergeOp> mergeOpProvider,
       Provider<MergeOpRepoManager> ormProvider,
       PublishCommentsOp.Factory publishCommentsOp,
@@ -568,7 +566,6 @@
     this.psUtil = psUtil;
     this.performanceLoggers = performanceLoggers;
     this.publishCommentsOp = publishCommentsOp;
-    this.queryProvider = queryProvider;
     this.receiveConfig = receiveConfig;
     this.refValidatorsFactory = refValidatorsFactory;
     this.replaceOpFactory = replaceOpFactory;
@@ -2931,18 +2928,27 @@
 
   private ChangeLookup lookupByChangeKey(RevCommit c, Change.Key key) {
     try (TraceTimer traceTimer = newTimer("lookupByChangeKey")) {
-      List<ChangeData> byBranchKeyExactMatch =
-          queryProvider.get().byBranchKey(magicBranch.dest, key).stream()
-              .filter(cd -> cd.change().getKey().equals(key))
-              .collect(toList());
-      return new ChangeLookup(c, key, byBranchKeyExactMatch);
+      List<ChangeData> byBranchKey =
+          retryHelper
+              .changeIndexQuery(
+                  "lookupByChangeKey",
+                  q ->
+                      q.byBranchKey(magicBranch.dest, key).stream()
+                          .filter(cd -> cd.change().getKey().equals(key))
+                          .collect(toList()))
+              .call();
+      return new ChangeLookup(c, key, byBranchKey);
     }
   }
 
   private ChangeLookup lookupByCommit(RevCommit c) {
     try (TraceTimer traceTimer = newTimer("lookupByCommit")) {
-      return new ChangeLookup(
-          c, null, queryProvider.get().byBranchCommit(magicBranch.dest, c.getName()));
+      List<ChangeData> byBranchCommit =
+          retryHelper
+              .changeIndexQuery(
+                  "lookupByCommit", q -> q.byBranchCommit(magicBranch.dest, c.getName()))
+              .call();
+      return new ChangeLookup(c, null, byBranchCommit);
     }
   }
 
diff --git a/java/com/google/gerrit/server/restapi/change/SuggestReviewers.java b/java/com/google/gerrit/server/restapi/change/SuggestReviewers.java
index 0035a03..b09ce21 100644
--- a/java/com/google/gerrit/server/restapi/change/SuggestReviewers.java
+++ b/java/com/google/gerrit/server/restapi/change/SuggestReviewers.java
@@ -29,9 +29,9 @@
 public class SuggestReviewers {
   private static final FluentLogger logger = FluentLogger.forEnclosingClass();
 
-  private static final int DEFAULT_MAX_SUGGESTED = 10;
+  public static final boolean DEFAULT_SKIP_SERVICE_USERS = true;
 
-  private static final boolean DEFAULT_SKIP_SERVICE_USERS = true;
+  private static final int DEFAULT_MAX_SUGGESTED = 10;
 
   protected final ReviewersUtil reviewersUtil;
 
diff --git a/modules/jgit b/modules/jgit
index 76ce6d9..cfdfb01 160000
--- a/modules/jgit
+++ b/modules/jgit
@@ -1 +1 @@
-Subproject commit 76ce6d91a2e07fdfcbfc8df6970c9e98a98e36a0
+Subproject commit cfdfb01f4c7de1d61a4913deac1d02837b53df82