private static boolean isMatchSafe(@NotNull String branch, @NotNull String pattern) {
    try {
      return branch.matches("^" + pattern + "$");
    }
    catch (PatternSyntaxException e) {
      if (LOG.isDebugEnabled()) {
        String cause = StringUtil.substringBefore(e.getMessage(), "\n");
        LOG.debug(GitBundle.message("settings.protected.branched.validation", pattern, cause));
      }
    }

    return false;
  }
private static boolean isMatchSafe(@NotNull String branch, @NotNull String pattern)