Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
PushOne: Log when skipping deletion of ref
Change-Id: I9d7d08e8c8a19ed6bbbb2c4a16287a8d9b51aa54
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 f4130e8..e5a3775 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
@@ -543,12 +543,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);
}
}
}