mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-05 03:40:56 +01:00
".git" extension not allowed on the end of repository name
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user