diff options
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r-- | routers/api/v1/repo/repo.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 29f6a675d4..e86743d55a 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -7,6 +7,7 @@ package repo import ( "fmt" "net/http" + "slices" "strings" "time" @@ -235,7 +236,7 @@ func CreateUserRepo(ctx *context.APIContext, owner *user_model.User, opt api.Cre } // If the readme template does not exist, a 400 will be returned. - if opt.AutoInit && len(opt.Readme) > 0 && !util.SliceContains(repo_module.Readmes, opt.Readme) { + if opt.AutoInit && len(opt.Readme) > 0 && !slices.Contains(repo_module.Readmes, opt.Readme) { ctx.Error(http.StatusBadRequest, "", fmt.Errorf("readme template does not exist, available templates: %v", repo_module.Readmes)) return } |