Merge branch 'stable-3.1'
* stable-3.1:
PushOne: Log when skipping deletion of ref
Change-Id: I708f1aa7c93aa4b655ed882fd87f32ed42fc94f2
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
index 36f52fa..72cb8fb 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
@@ -556,12 +556,14 @@
if (config.isMirror()) {
for (Ref ref : remote.values()) {
- if (!Constants.HEAD.equals(ref.getName())) {
- RefSpec spec = matchDst(ref.getName());
- if (spec != null && !local.containsKey(spec.getSource())) {
- // No longer on local side, request removal.
- delete(cmds, spec);
- }
+ if (Constants.HEAD.equals(ref.getName())) {
+ repLog.atFine().log("Skipping deletion of %s", ref.getName());
+ continue;
+ }
+ RefSpec spec = matchDst(ref.getName());
+ if (spec != null && !local.containsKey(spec.getSource())) {
+ // No longer on local side, request removal.
+ delete(cmds, spec);
}
}
}