aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-06-12 23:51:54 +0800
committerGitHub <noreply@github.com>2022-06-12 23:51:54 +0800
commit110fc57cbcf293c19ed7017d8ea528b4bbbd7396 (patch)
treeb36eb2ee0e3f8417a35ad095e25880b778ded0ba /cmd
parenta9dc9b06e4a4106ec8315fe7b2922efa440ca199 (diff)
downloadgitea-110fc57cbcf293c19ed7017d8ea528b4bbbd7396.tar.gz
gitea-110fc57cbcf293c19ed7017d8ea528b4bbbd7396.zip
Move some code into models/git (#19879)
* Move access and repo permission to models/perm/access * fix test * Move some git related files into sub package models/git * Fix build * fix git test * move lfs to sub package * move more git related functions to models/git * Move functions sequence * Some improvements per @KN4CK3R and @delvh
Diffstat (limited to 'cmd')
-rw-r--r--cmd/migrate_storage.go4
-rw-r--r--cmd/serv.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/cmd/migrate_storage.go b/cmd/migrate_storage.go
index f9770d50e7..93fb64a4d3 100644
--- a/cmd/migrate_storage.go
+++ b/cmd/migrate_storage.go
@@ -9,8 +9,8 @@ import (
"fmt"
"strings"
- "code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
+ git_model "code.gitea.io/gitea/models/git"
"code.gitea.io/gitea/models/migrations"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
@@ -88,7 +88,7 @@ func migrateAttachments(dstStorage storage.ObjectStorage) error {
}
func migrateLFS(dstStorage storage.ObjectStorage) error {
- return models.IterateLFS(func(mo *models.LFSMetaObject) error {
+ return git_model.IterateLFS(func(mo *git_model.LFSMetaObject) error {
_, err := storage.Copy(dstStorage, mo.RelativePath(), storage.LFS, mo.RelativePath())
return err
})
diff --git a/cmd/serv.go b/cmd/serv.go
index 6e067a48a5..b00c3962f4 100644
--- a/cmd/serv.go
+++ b/cmd/serv.go
@@ -17,8 +17,8 @@ import (
"strings"
"time"
- "code.gitea.io/gitea/models"
asymkey_model "code.gitea.io/gitea/models/asymkey"
+ git_model "code.gitea.io/gitea/models/git"
"code.gitea.io/gitea/models/perm"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/json"
@@ -276,7 +276,7 @@ func runServ(c *cli.Context) error {
return fail("Internal error", "Failed to sign JWT token: %v", err)
}
- tokenAuthentication := &models.LFSTokenResponse{
+ tokenAuthentication := &git_model.LFSTokenResponse{
Header: make(map[string]string),
Href: url,
}