aboutsummaryrefslogtreecommitdiff
path: root/internal/db/repo.go
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2022-11-05 18:56:48 +0800
committerGitHub <noreply@github.com>2022-11-05 18:56:48 +0800
commitb5d47b969258f3d644ad797b29901eb607f6b94f (patch)
tree790d2f06c0fc1dc0442c3869edf7fcd2dd6a8e42 /internal/db/repo.go
parentfd798b4197dc53df872d20f5d10edb8d73c32386 (diff)
refactor(db): migrate methods off `user.go` (#7230)
Diffstat (limited to 'internal/db/repo.go')
-rw-r--r--internal/db/repo.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/db/repo.go b/internal/db/repo.go
index bb2cd52e..81a6cd00 100644
--- a/internal/db/repo.go
+++ b/internal/db/repo.go
@@ -1081,8 +1081,14 @@ func initRepository(e Engine, repoPath string, doer *User, repo *Repository, opt
}
var (
- reservedRepoNames = []string{".", ".."}
- reservedRepoPatterns = []string{"*.git", "*.wiki"}
+ reservedRepoNames = map[string]struct{}{
+ ".": {},
+ "..": {},
+ }
+ reservedRepoPatterns = []string{
+ "*.git",
+ "*.wiki",
+ }
)
// isRepoNameAllowed return an error if given name is a reserved name or pattern for repositories.