private void configureBranches()

in src/main/java/com/googlesource/gerrit/plugins/its/base/its/InitIts.java [121:154]


  private void configureBranches(Config cfg) {
    String[] branches = cfg.getStringList("plugin", pluginName, "branch");
    if (branches.length > 1) {
      ui.message(
          "The issue tracker integration is configured for multiple branches."
              + " Please adapt the configuration in the 'project.config' file of the '%s' project.\n",
          allProjects.get());
      return;
    }

    String branch = branches.length == 1 ? branches[0] : null;
    if (Strings.isNullOrEmpty(branch)) {
      branch = "refs/heads/*";
    }

    boolean validRef;
    do {
      String v =
          ui.readString(
              branch,
              "Branches for which the issue tracker integration"
                  + " should be enabled (ref, ref pattern or regular expression)");
      validRef = AccessSection.isValidRefSectionName(v);
      if (validRef) {
        branch = v;
      } else {
        ui.message(
            "'%s' is not valid. Please specify a valid ref, ref pattern or regular expression\n",
            v);
      }
    } while (!validRef);

    cfg.setString("plugin", pluginName, "branch", branch);
  }