Merge branch 'develop' into feature/source_jump

# Conflicts:
#	CHANGELOG.md
This commit is contained in:
Konstantin Schaper
2020-08-10 12:37:05 +02:00
71 changed files with 3305 additions and 421 deletions

View File

@@ -37,7 +37,7 @@ describe("repository name validation", () => {
});
it("should allow same names as the backend", () => {
const validPaths = ["scm", "s", "sc", ".hiddenrepo", "b.", "...", "..c", "d..", "a..c"];
const validPaths = ["scm", "scm.gitz", "s", "sc", ".hiddenrepo", "b.", "...", "..c", "d..", "a..c"];
validPaths.forEach(path => expect(validator.isNameValid(path)).toBe(true));
});
@@ -91,7 +91,8 @@ describe("repository name validation", () => {
"a/..b",
"scm/main",
"scm/plugins/git-plugin",
"scm/plugins/git-plugin"
"scm/plugins/git-plugin",
"scm.git"
];
invalidPaths.forEach(path => expect(validator.isNameValid(path)).toBe(false));

View File

@@ -24,7 +24,7 @@
import { validation } from "@scm-manager/ui-components";
const nameRegex = /(?!^\.\.$)(?!^\.$)(?!.*[\\\[\]])^[A-Za-z0-9\.][A-Za-z0-9\.\-_]*$/;
const nameRegex = /(?!^\.\.$)(?!^\.$)(?!.*[.]git$)(?!.*[\\\[\]])^[A-Za-z0-9\.][A-Za-z0-9\.\-_]*$/;
export const isNameValid = (name: string) => {
return nameRegex.test(name);