Skip to content

Commit 87d5f96

Browse files
committed
fix: fix integrationtest
1 parent 634c4ee commit 87d5f96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

controller/branch_ctl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
)
2121

2222
var MaxBranchNameLength = 40
23-
var branchNameRegex = regexp.MustCompile(`^\w[-\w]*$`)
23+
var branchNameRegex = regexp.MustCompile(`^[\w]+\/?[\w]+$`)
2424

2525
func CheckBranchName(name string) error {
2626
for _, blackName := range RepoNameBlackList {

controller/repository_ctl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
const DefaultBranchName = "main"
2828

2929
var repoLog = logging.Logger("repo control")
30-
var alphanumeric = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]$`)
30+
var alphanumeric = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_\-]{1,61}[a-zA-Z0-9]$`)
3131

3232
// RepoNameBlackList forbid repo name, reserve for routes
3333
var RepoNameBlackList = []string{"repository", "repositories", "wip", "wips", "object", "objects", "commit", "commits", "ref", "refs", "repo", "repos", "user", "users"}

0 commit comments

Comments
 (0)