".git" extension not allowed on the end of repository name

This commit is contained in:
Eduard Heimbuch
2020-08-10 11:54:19 +02:00
parent 4dec7ebe7b
commit c813a5f723
2 changed files with 4 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ public final class ValidationUtil
public static final String REGEX_NAME =
"^[A-Za-z0-9\\.\\-_][A-Za-z0-9\\.\\-_@]*$";
public static final String REGEX_REPOSITORYNAME = "(?!^\\.\\.$)(?!^\\.$)(?!.*[\\\\\\[\\]])^[A-Za-z0-9\\.][A-Za-z0-9\\.\\-_]*$";
public static final String REGEX_REPOSITORYNAME = "(?!^\\.\\.$)(?!^\\.$)(?!.*[\\\\\\[\\]])(?!.*[.]git$)^[A-Za-z0-9\\.][A-Za-z0-9\\.\\-_]*$";
/** Field description */
private static final Pattern PATTERN_REPOSITORYNAME = Pattern.compile(REGEX_REPOSITORYNAME);

View File

@@ -202,7 +202,9 @@ public class ValidationUtilTest
"scm/main",
"scm/plugins/git-plugin",
"_scm",
"-scm"
"-scm",
"scm.git",
"scm.git.git"
};
for (String path : validPaths) {