From 8e58fe2536c0a477c4774d90ca60521b4ea1b14b Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 17 Sep 2022 11:41:29 +0800 Subject: [PATCH] Remove unnecessary length check for repo's Description & Website --- modules/repository/create.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/repository/create.go b/modules/repository/create.go index 7a25323def921..966a6a2f211ed 100644 --- a/modules/repository/create.go +++ b/modules/repository/create.go @@ -10,7 +10,6 @@ import ( "os" "path" "strings" - "unicode/utf8" "code.gitea.io/gitea/models" activities_model "code.gitea.io/gitea/models/activities" @@ -337,13 +336,6 @@ func CheckDaemonExportOK(ctx context.Context, repo *repo_model.Repository) error func UpdateRepository(ctx context.Context, repo *repo_model.Repository, visibilityChanged bool) (err error) { repo.LowerName = strings.ToLower(repo.Name) - if utf8.RuneCountInString(repo.Description) > 255 { - repo.Description = string([]rune(repo.Description)[:255]) - } - if utf8.RuneCountInString(repo.Website) > 255 { - repo.Website = string([]rune(repo.Website)[:255]) - } - e := db.GetEngine(ctx) if _, err = e.ID(repo.ID).AllCols().Update(repo); err != nil {