Merge "Move users of Branch constants to RefNames constants."
This commit is contained in:
commit
28fd0301aa
@ -17,9 +17,9 @@ package com.google.gerrit.client.ui;
|
||||
import com.google.gerrit.client.Gerrit;
|
||||
import com.google.gerrit.client.changes.QueryScreen;
|
||||
import com.google.gerrit.common.PageLinks;
|
||||
import com.google.gerrit.reviewdb.client.Branch;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.reviewdb.client.RefNames;
|
||||
|
||||
/** Link to the open changes of a project. */
|
||||
public class BranchLink extends InlineHyperlink {
|
||||
@ -61,10 +61,10 @@ public class BranchLink extends InlineHyperlink {
|
||||
String branch, String topic) {
|
||||
String query = PageLinks.projectQuery(project, status);
|
||||
|
||||
if (branch.startsWith(Branch.R_REFS)) {
|
||||
if (branch.startsWith(Branch.R_HEADS)) {
|
||||
if (branch.startsWith(RefNames.REFS)) {
|
||||
if (branch.startsWith(RefNames.REFS_HEADS)) {
|
||||
query += " " + PageLinks.op("branch", //
|
||||
branch.substring(Branch.R_HEADS.length()));
|
||||
branch.substring(RefNames.REFS_HEADS.length()));
|
||||
} else {
|
||||
query += " " + PageLinks.op("ref", branch);
|
||||
}
|
||||
|
@ -19,9 +19,6 @@ import com.google.gwtorm.client.StringKey;
|
||||
|
||||
/** Line of development within a {@link Project}. */
|
||||
public final class Branch {
|
||||
public static final String R_HEADS = "refs/heads/";
|
||||
public static final String R_REFS = "refs/";
|
||||
|
||||
/** Branch name key */
|
||||
public static class NameKey extends StringKey<Project.NameKey> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -20,7 +20,7 @@ import static org.eclipse.jgit.lib.RefDatabase.ALL;
|
||||
import com.google.gerrit.common.data.GlobalCapability;
|
||||
import com.google.gerrit.extensions.annotations.RequiresCapability;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.Branch;
|
||||
import com.google.gerrit.reviewdb.client.RefNames;
|
||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
import com.google.gerrit.server.IdentifiedUser;
|
||||
import com.google.gerrit.server.account.AccountResolver;
|
||||
@ -110,7 +110,7 @@ public class LsUserRefs extends SshCommand {
|
||||
db, true).filter(repo.getRefDatabase().getRefs(ALL), false);
|
||||
|
||||
for (final String ref : refsMap.keySet()) {
|
||||
if (!onlyRefsHeads || ref.startsWith(Branch.R_HEADS)) {
|
||||
if (!onlyRefsHeads || ref.startsWith(RefNames.REFS_HEADS)) {
|
||||
stdout.println(ref);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user