Fix: Inconsistent behaviour when replicating refs/meta/config

In replication.config, if authGroup is set to be used together
with mirror = true, refs blocked through the authGroup are deleted
from the slave/mirror. The same still (and rightly) applies if
the authGroup is used to block refs/meta/config.

However, if replicatePermission set to false, gerrit will refuse
to clean up refs/meta/config on the slave/mirror.

This fix makes sure that the Gerrit is still allowed to clean
up all refs on the mirror, including refs/meta/config, even when
used in conjunction with replicatePermission = false.

Change-Id: Iea3f00e976d2d3e0bd8cb632530f65d79d9943ba
This commit is contained in:
Gustaf Lundh
2012-03-26 16:01:40 +02:00
parent 53f0f79da8
commit c8feec1efc

View File

@@ -343,10 +343,6 @@ class PushOp implements ProjectRunnable {
if (config.isMirror()) {
for (final Ref ref : remote.values()) {
if (noPerms && GitRepositoryManager.REF_CONFIG.equals(ref.getName())) {
continue;
}
if (!Constants.HEAD.equals(ref.getName())) {
final RefSpec spec = matchDst(ref.getName());
if (spec != null && !local.containsKey(spec.getSource())) {
@@ -360,16 +356,13 @@ class PushOp implements ProjectRunnable {
} else {
for (final String src : delta) {
if (noPerms && GitRepositoryManager.REF_CONFIG.equals(src)) {
continue;
}
final RefSpec spec = matchSrc(src);
if (spec != null) {
// If the ref still exists locally, send it, otherwise delete it.
//
Ref srcRef = local.get(src);
if (srcRef != null) {
if (srcRef != null &&
!(noPerms && GitRepositoryManager.REF_CONFIG.equals(src))) {
send(cmds, spec, srcRef);
} else if (config.isMirror()) {
delete(cmds, spec);