boolean (@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; }