* 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
Showing the changes to modules/gitgraph/graph_models.go (1 of 67 files). Show all
Unified · Split
| @@ -9,9 +9,9 @@ import ( · 8 unmodified lines | |||
| 9 | "fmt" | 9 | "fmt" |
| 10 | "strings" | 10 | "strings" |
| 11 | 11 | ||
| 12 | "code.gitea.io/gitea/models" | ||
| 13 | asymkey_model "code.gitea.io/gitea/models/asymkey" | 12 | asymkey_model "code.gitea.io/gitea/models/asymkey" |
| 14 | "code.gitea.io/gitea/models/db" | 13 | "code.gitea.io/gitea/models/db" |
| 14 | git_model "code.gitea.io/gitea/models/git" | ||
| 15 | repo_model "code.gitea.io/gitea/models/repo" | 15 | repo_model "code.gitea.io/gitea/models/repo" |
| 16 | user_model "code.gitea.io/gitea/models/user" | 16 | user_model "code.gitea.io/gitea/models/user" |
| 17 | "code.gitea.io/gitea/modules/git" | 17 | "code.gitea.io/gitea/modules/git" |
| @@ -117,14 +117,14 @@ func (graph *Graph) LoadAndProcessCommits(repository *repo_model.Repository, git · 99 unmodified lines | |||
| 117 | c.Verification = asymkey_model.ParseCommitWithSignature(c.Commit) | 117 | c.Verification = asymkey_model.ParseCommitWithSignature(c.Commit) |
| 118 | 118 | ||
| 119 | _ = asymkey_model.CalculateTrustStatus(c.Verification, repository.GetTrustModel(), func(user *user_model.User) (bool, error) { | 119 | _ = asymkey_model.CalculateTrustStatus(c.Verification, repository.GetTrustModel(), func(user *user_model.User) (bool, error) { |
| 120 | return models.IsOwnerMemberCollaborator(repository, user.ID) | 120 | return repo_model.IsOwnerMemberCollaborator(repository, user.ID) |
| 121 | }, &keyMap) | 121 | }, &keyMap) |
| 122 | 122 | ||
| 123 | statuses, _, err := models.GetLatestCommitStatus(db.DefaultContext, repository.ID, c.Commit.ID.String(), db.ListOptions{}) | 123 | statuses, _, err := git_model.GetLatestCommitStatus(db.DefaultContext, repository.ID, c.Commit.ID.String(), db.ListOptions{}) |
| 124 | if err != nil { | 124 | if err != nil { |
| 125 | log.Error("GetLatestCommitStatus: %v", err) | 125 | log.Error("GetLatestCommitStatus: %v", err) |
| 126 | } else { | 126 | } else { |
| 127 | c.Status = models.CalcCommitStatus(statuses) | 127 | c.Status = git_model.CalcCommitStatus(statuses) |
| 128 | } | 128 | } |
| 129 | } | 129 | } |
| 130 | return nil | 130 | return nil |
| @@ -240,7 +240,7 @@ type Commit struct { · 109 unmodified lines | |||
| 240 | Commit *git.Commit | 240 | Commit *git.Commit |
| 241 | User *user_model.User | 241 | User *user_model.User |
| 242 | Verification *asymkey_model.CommitVerification | 242 | Verification *asymkey_model.CommitVerification |
| 243 | Status *models.CommitStatus | 243 | Status *git_model.CommitStatus |
| 244 | Flow int64 | 244 | Flow int64 |
| 245 | Row int | 245 | Row int |
| 246 | Column int | 246 | Column int |