summaryrefslogtreecommitdiffstats
path: root/modules/gitgraph/graph_models.go
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 /modules/gitgraph/graph_models.go
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 'modules/gitgraph/graph_models.go')
-rw-r--r--modules/gitgraph/graph_models.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gitgraph/graph_models.go b/modules/gitgraph/graph_models.go
index 551e56f63e..c153e5d3be 100644
--- a/modules/gitgraph/graph_models.go
+++ b/modules/gitgraph/graph_models.go
@@ -9,9 +9,9 @@ import (
"fmt"
"strings"
- "code.gitea.io/gitea/models"
asymkey_model "code.gitea.io/gitea/models/asymkey"
"code.gitea.io/gitea/models/db"
+ git_model "code.gitea.io/gitea/models/git"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/git"
@@ -117,14 +117,14 @@ func (graph *Graph) LoadAndProcessCommits(repository *repo_model.Repository, git
c.Verification = asymkey_model.ParseCommitWithSignature(c.Commit)
_ = asymkey_model.CalculateTrustStatus(c.Verification, repository.GetTrustModel(), func(user *user_model.User) (bool, error) {
- return models.IsOwnerMemberCollaborator(repository, user.ID)
+ return repo_model.IsOwnerMemberCollaborator(repository, user.ID)
}, &keyMap)
- statuses, _, err := models.GetLatestCommitStatus(db.DefaultContext, repository.ID, c.Commit.ID.String(), db.ListOptions{})
+ statuses, _, err := git_model.GetLatestCommitStatus(db.DefaultContext, repository.ID, c.Commit.ID.String(), db.ListOptions{})
if err != nil {
log.Error("GetLatestCommitStatus: %v", err)
} else {
- c.Status = models.CalcCommitStatus(statuses)
+ c.Status = git_model.CalcCommitStatus(statuses)
}
}
return nil
@@ -240,7 +240,7 @@ type Commit struct {
Commit *git.Commit
User *user_model.User
Verification *asymkey_model.CommitVerification
- Status *models.CommitStatus
+ Status *git_model.CommitStatus
Flow int64
Row int
Column int