summaryrefslogtreecommitdiffstats
path: root/modules/gitgraph
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-24 17:49:20 +0800
committerGitHub <noreply@github.com>2021-11-24 17:49:20 +0800
commita666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch)
tree9ab1434b759a8a2cb275a83149903a823851e309 /modules/gitgraph
parent4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff)
downloadgitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.tar.gz
gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.zip
Move user related model into models/user (#17781)
* Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
Diffstat (limited to 'modules/gitgraph')
-rw-r--r--modules/gitgraph/graph_models.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/gitgraph/graph_models.go b/modules/gitgraph/graph_models.go
index 95f761742e..d7d198e01c 100644
--- a/modules/gitgraph/graph_models.go
+++ b/modules/gitgraph/graph_models.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
)
@@ -91,7 +92,7 @@ func (graph *Graph) LoadAndProcessCommits(repository *models.Repository, gitRepo
var ok bool
- emails := map[string]*models.User{}
+ emails := map[string]*user_model.User{}
keyMap := map[string]bool{}
for _, c := range graph.Commits {
@@ -106,7 +107,7 @@ func (graph *Graph) LoadAndProcessCommits(repository *models.Repository, gitRepo
if c.Commit.Author != nil {
email := c.Commit.Author.Email
if c.User, ok = emails[email]; !ok {
- c.User, _ = models.GetUserByEmail(email)
+ c.User, _ = user_model.GetUserByEmail(email)
emails[email] = c.User
}
}
@@ -233,7 +234,7 @@ func newRefsFromRefNames(refNames []byte) []git.Reference {
// Commit represents a commit at co-ordinate X, Y with the data
type Commit struct {
Commit *git.Commit
- User *models.User
+ User *user_model.User
Verification *models.CommitVerification
Status *models.CommitStatus
Flow int64