summaryrefslogtreecommitdiffstats
path: root/models/repo_generate.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-10-14 21:07:51 +0800
committerGitHub <noreply@github.com>2020-10-14 21:07:51 +0800
commit80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc (patch)
tree504c7ccdc9cb42e0e282abdd8dbb75c4b24e9f5b /models/repo_generate.go
parent93f7525061bc9e6f5be734aba0de31b64c63d7a8 (diff)
downloadgitea-80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc.tar.gz
gitea-80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc.zip
Avatars and Repo avatars support storing in minio (#12516)
* Avatar support minio * Support repo avatar minio storage * Add missing migration * Fix bug * Fix test * Add test for minio store type on avatars and repo avatars; Add documents * Fix bug * Fix bug * Add back missed avatar link method * refactor codes * Simplify the codes * Code improvements * Fix lint * Fix test mysql * Fix test mysql * Fix test mysql * Fix settings * Fix test * fix test * Fix bug
Diffstat (limited to 'models/repo_generate.go')
-rw-r--r--models/repo_generate.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/repo_generate.go b/models/repo_generate.go
index 480683cd4a..0b234d8e34 100644
--- a/models/repo_generate.go
+++ b/models/repo_generate.go
@@ -10,10 +10,10 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
+ "code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/modules/util"
"github.com/gobwas/glob"
- "github.com/unknwon/com"
)
// GenerateRepoOptions contains the template units to generate
@@ -139,7 +139,7 @@ func GenerateWebhooks(ctx DBContext, templateRepo, generateRepo *Repository) err
// GenerateAvatar generates the avatar from a template repository
func GenerateAvatar(ctx DBContext, templateRepo, generateRepo *Repository) error {
generateRepo.Avatar = strings.Replace(templateRepo.Avatar, strconv.FormatInt(templateRepo.ID, 10), strconv.FormatInt(generateRepo.ID, 10), 1)
- if err := com.Copy(templateRepo.CustomAvatarPath(), generateRepo.CustomAvatarPath()); err != nil {
+ if _, err := storage.Copy(storage.RepoAvatars, generateRepo.CustomAvatarRelativePath(), storage.RepoAvatars, templateRepo.CustomAvatarRelativePath()); err != nil {
return err
}