Restore the fetching of all refs with empty delta

When the FetchOne's delta is empty the fetching should run
with all refs. This fixes a regression introduced by I093ce3a7
when the recover from failed fetch of individual refs has
mistakenly skipped also the all refs fetching.

Change-Id: I3ea2769d7819b2b79ec2d4f2b9514fc91dee7c3e
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/FetchOne.java b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/FetchOne.java
index c028d84..3467460 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/FetchOne.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/FetchOne.java
@@ -417,11 +417,6 @@
   }
 
   private void runImpl() throws IOException {
-    if (delta.isEmpty()) {
-      repLog.warn("Empty replication task [{}], skipping.", taskIdHex);
-      return;
-    }
-
     Fetch fetch = fetchFactory.create(taskIdHex, uri, git);
     List<RefSpec> fetchRefSpecs = getFetchRefSpecs();
 
@@ -436,6 +431,11 @@
           inexistentRef);
       fetchFailures.add(e);
       delta.remove(inexistentRef);
+      if (delta.isEmpty()) {
+        repLog.warn("[{}] Empty replication task, skipping.", taskIdHex);
+        return;
+      }
+
       runImpl();
     }
   }