diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2019-03-01 08:17:32 -0600 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2019-03-06 11:30:44 +0100 |
commit | f02eeba4ef9908da5d6e5ea969e91a22c6c443cd (patch) | |
tree | c2cee4e353bc2ac5fb909378624d592b988c6162 /sonar-core | |
parent | b41f2655daa7d58a272f0f98ac1ec16ff10f6e24 (diff) | |
download | sonarqube-f02eeba4ef9908da5d6e5ea969e91a22c6c443cd.tar.gz sonarqube-f02eeba4ef9908da5d6e5ea969e91a22c6c443cd.zip |
SONAR-11561 Allow more special characters in branch names
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java | 2 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java b/sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java index 93cbbe0439f..a3bb4fb1453 100644 --- a/sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java +++ b/sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java @@ -111,7 +111,7 @@ public final class ComponentKeys { * * @return <code>true</code> if <code>branchCandidate</code> can be used for a project */ - public static boolean isValidBranch(String branchCandidate) { + public static boolean isValidLegacyBranch(String branchCandidate) { return branchCandidate.matches(VALID_BRANCH_REGEXP); } diff --git a/sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java b/sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java index d4f45a69769..a328a0c586b 100644 --- a/sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java +++ b/sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java @@ -68,14 +68,14 @@ public class ComponentKeysTest { @Test public void isValidBranchKey() { - assertThat(ComponentKeys.isValidBranch("")).isTrue(); - assertThat(ComponentKeys.isValidBranch("abc")).isTrue(); - assertThat(ComponentKeys.isValidBranch("0123")).isTrue(); - assertThat(ComponentKeys.isValidBranch("ab 12")).isFalse(); - assertThat(ComponentKeys.isValidBranch("ab_12")).isTrue(); - assertThat(ComponentKeys.isValidBranch("ab/12")).isTrue(); - assertThat(ComponentKeys.isValidBranch("ab\\12")).isFalse(); - assertThat(ComponentKeys.isValidBranch("ab\n")).isFalse(); + assertThat(ComponentKeys.isValidLegacyBranch("")).isTrue(); + assertThat(ComponentKeys.isValidLegacyBranch("abc")).isTrue(); + assertThat(ComponentKeys.isValidLegacyBranch("0123")).isTrue(); + assertThat(ComponentKeys.isValidLegacyBranch("ab 12")).isFalse(); + assertThat(ComponentKeys.isValidLegacyBranch("ab_12")).isTrue(); + assertThat(ComponentKeys.isValidLegacyBranch("ab/12")).isTrue(); + assertThat(ComponentKeys.isValidLegacyBranch("ab\\12")).isFalse(); + assertThat(ComponentKeys.isValidLegacyBranch("ab\n")).isFalse(); } @Test |