diff options
author | Hugo Arès <hugo.ares@ericsson.com> | 2016-05-25 23:47:27 -0400 |
---|---|---|
committer | Hugo Arès <hugo.ares@ericsson.com> | 2016-05-25 23:48:13 -0400 |
commit | 43af15baab9b2312677000c47313026f34352abb (patch) | |
tree | bd2898bf243c998176a9fd400a05d5ad02bdcb2f | |
parent | 945c842f9c884469ec0fb2d883d6cda552e97747 (diff) | |
parent | 7cbcfd2a3a507472eb244cf1a773b177d291d253 (diff) |
Merge branch 'stable-2.12'
* stable-2.12:
Double check if a ref is missing locally before deleting from remote
Change-Id: I17606a232991b267a6828a5203f972eb5b7232a1
-rw-r--r-- | src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java | 6 |
1 files changed, 6 insertions, 0 deletions
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 af8bdc7..0c74a6f 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java @@ -483,6 +483,12 @@ class PushOne implements ProjectRunnable { if (spec != null) { // If the ref still exists locally, send it, otherwise delete it. Ref srcRef = local.get(src); + + // Second try to ensure that the ref is truly not found locally + if (srcRef == null) { + srcRef = git.getRef(src); + } + if (srcRef != null && canPushRef(src, noPerms)) { push(cmds, spec, srcRef); } else if (config.isMirror()) { |