Merge branch 'stable-3.11'

* stable-3.11:
  Do not lock refs when not executing a fetch
  Allow locking refs whilst filtering for fetch requests
  Remove unused Transport in FetchOneTest
  Avoid mocking ReplicationFetchFilter
  Remove redundant public modifier in ReplicationFetchFilter
  Record replication metrics for retrying tasks

Change-Id: I63317ad5f0f98e988844bf40f81522fec014641a
diff --git a/src/main/resources/Documentation/about.md b/README.md
similarity index 65%
rename from src/main/resources/Documentation/about.md
rename to README.md
index 247ff23..c7ee16a 100644
--- a/src/main/resources/Documentation/about.md
+++ b/README.md
@@ -1,25 +1,32 @@
+# Gerrit pull-replication plugin
+
 This plugin can automatically mirror repositories from other systems.
 
 Overview
 --------
 
 Typically replication should be done over SSH, with a passwordless
-public/private key pair.  On a trusted network it is also possible to
+public/private key pair. On a trusted network it is also possible to
 use replication over the insecure (but much faster due to no
 authentication overhead or encryption) git:// protocol, by enabling
 the `upload-pack` service on the receiving system, but this
-configuration is not recommended.  It is also possible to specify a
-local path as replication source. This makes e.g. sense if a network
+configuration is not recommended. It is also possible to specify a
+local path as replication source. This makes sense if a network
 share is mounted to which the repositories should be replicated from.
 
-Access
-------
+## Access
+
 
 To be allowed to trigger pull replication a user must be a member of a
 group that is granted the 'Pull Replication' capability (provided
 by this plugin) or the 'Administrate Server' capability.
 
-Change Indexing
---------
+## Change Indexing
+
 
 Changes will be automatically indexed upon replication.
+
+
+For more information please refer to the [docs](src/main/resources/Documentation)
+
+
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/PullReplicationModule.java b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/PullReplicationModule.java
index 251f39f..a01a6d8 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/PullReplicationModule.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/PullReplicationModule.java
@@ -34,6 +34,7 @@
 import com.google.inject.assistedinject.FactoryModuleBuilder;
 import com.google.inject.internal.UniqueAnnotations;
 import com.google.inject.name.Names;
+import com.googlesource.gerrit.plugins.deleteproject.cache.CacheDeleteHandler;
 import com.googlesource.gerrit.plugins.replication.AutoReloadSecureCredentialsFactoryDecorator;
 import com.googlesource.gerrit.plugins.replication.ConfigParser;
 import com.googlesource.gerrit.plugins.replication.CredentialsFactory;
@@ -42,6 +43,7 @@
 import com.googlesource.gerrit.plugins.replication.StartReplicationCapability;
 import com.googlesource.gerrit.plugins.replication.pull.api.FetchApiCapability;
 import com.googlesource.gerrit.plugins.replication.pull.api.FetchJob;
+import com.googlesource.gerrit.plugins.replication.pull.api.ProjectDeletionAction;
 import com.googlesource.gerrit.plugins.replication.pull.auth.PullReplicationGroupModule;
 import com.googlesource.gerrit.plugins.replication.pull.client.FetchApiClient;
 import com.googlesource.gerrit.plugins.replication.pull.client.FetchRestApiClient;
@@ -68,6 +70,9 @@
 
   @Override
   protected void configure() {
+    bind(CacheDeleteHandler.class);
+    bind(ProjectDeletionAction.class).in(Scopes.SINGLETON);
+
     bind(MetricMaker.class)
         .annotatedWith(Names.named(ReplicationQueueMetrics.REPLICATION_QUEUE_METRICS))
         .toInstance(pluginMetricMaker);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/api/HttpModule.java b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/api/HttpModule.java
index 72a0182..95082b8 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/api/HttpModule.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/api/HttpModule.java
@@ -20,7 +20,6 @@
 import com.google.inject.Scopes;
 import com.google.inject.name.Names;
 import com.google.inject.servlet.ServletModule;
-import com.googlesource.gerrit.plugins.deleteproject.cache.CacheDeleteHandler;
 import com.googlesource.gerrit.plugins.replication.pull.BearerTokenProvider;
 
 public class HttpModule extends ServletModule {
@@ -47,9 +46,6 @@
                   .in(Scopes.SINGLETON);
             });
 
-    bind(CacheDeleteHandler.class);
-    bind(ProjectDeletionAction.class).in(Scopes.SINGLETON);
-
     DynamicSet.bind(binder(), AllRequestFilter.class)
         .to(PullReplicationFilter.class)
         .in(Scopes.SINGLETON);