Update to use RefNames constants Gerrit change I76e6ee7e63a4549b51a43698fb50b54a19dabfc6 Change-Id: Id461a09817fc4dfb3d4306c72d91fd7a24deb282
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java index 9edf501..0da6cb2 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
@@ -22,6 +22,7 @@ import com.google.gerrit.common.data.GroupReference; import com.google.gerrit.reviewdb.client.AccountGroup; import com.google.gerrit.reviewdb.client.Project; +import com.google.gerrit.reviewdb.client.RefNames; import com.google.gerrit.reviewdb.server.ReviewDb; import com.google.gerrit.server.CurrentUser; import com.google.gerrit.server.PluginUser; @@ -235,7 +236,7 @@ Ref head = git.getRef(Constants.HEAD); if (head != null && head.isSymbolic() - && GitRepositoryManager.REF_CONFIG.equals(head.getLeaf().getName())) { + && RefNames.REFS_CONFIG.equals(head.getLeaf().getName())) { return; } } catch (IOException err) { @@ -433,7 +434,7 @@ } boolean wouldPushRef(String ref) { - if (!replicatePermissions && GitRepositoryManager.REF_CONFIG.equals(ref)) { + if (!replicatePermissions && RefNames.REFS_CONFIG.equals(ref)) { return false; } for (RefSpec s : remote.getPushRefSpecs()) {
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 e246cd1..93f261e 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
@@ -23,6 +23,7 @@ import com.google.gerrit.extensions.events.GitReferenceUpdatedListener; import com.google.gerrit.extensions.events.NewProjectCreatedListener; import com.google.gerrit.reviewdb.client.Project; +import com.google.gerrit.reviewdb.client.RefNames; import com.google.gerrit.reviewdb.server.ReviewDb; import com.google.gerrit.server.git.ChangeCache; import com.google.gerrit.server.git.GitRepositoryManager; @@ -38,7 +39,6 @@ import com.google.inject.assistedinject.Assisted; import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult; - import com.jcraft.jsch.JSchException; import org.eclipse.jgit.errors.NoRemoteRepositoryException; @@ -417,7 +417,7 @@ boolean noPerms = !pool.isReplicatePermissions(); Map<String, Ref> remote = listRemote(tn); for (Ref src : local.values()) { - if (noPerms && GitRepositoryManager.REF_CONFIG.equals(src.getName())) { + if (noPerms && RefNames.REFS_CONFIG.equals(src.getName())) { continue; } @@ -455,7 +455,7 @@ // If the ref still exists locally, send it, otherwise delete it. Ref srcRef = local.get(src); if (srcRef != null && - !(noPerms && GitRepositoryManager.REF_CONFIG.equals(src))) { + !(noPerms && RefNames.REFS_CONFIG.equals(src))) { push(cmds, spec, srcRef); } else if (config.isMirror()) { delete(cmds, spec);