summaryrefslogtreecommitdiffstats
path: root/models/commit.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-10 16:14:24 +0800
committerGitHub <noreply@github.com>2021-12-10 16:14:24 +0800
commit3ca5dc7e32b372d14ff80d96f14b8f6a805862f1 (patch)
tree50d193ed0dacf2888d57b193a9b0d36065aff205 /models/commit.go
parent0a9fcf63a49799ad3b0f146c54879161bac61e10 (diff)
downloadgitea-3ca5dc7e32b372d14ff80d96f14b8f6a805862f1.tar.gz
gitea-3ca5dc7e32b372d14ff80d96f14b8f6a805862f1.zip
Move keys to models/asymkey (#17917)
* Move keys to models/keys * Rename models/keys -> models/asymkey * change the missed package name * Fix package alias * Fix test * Fix docs * Fix test * Fix test * merge
Diffstat (limited to 'models/commit.go')
-rw-r--r--models/commit.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/models/commit.go b/models/commit.go
index 8de71da1b3..5df6964a1d 100644
--- a/models/commit.go
+++ b/models/commit.go
@@ -5,6 +5,7 @@
package models
import (
+ asymkey_model "code.gitea.io/gitea/models/asymkey"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/git"
@@ -13,9 +14,12 @@ import (
// ConvertFromGitCommit converts git commits into SignCommitWithStatuses
func ConvertFromGitCommit(commits []*git.Commit, repo *repo_model.Repository) []*SignCommitWithStatuses {
return ParseCommitsWithStatus(
- ParseCommitsWithSignature(
+ asymkey_model.ParseCommitsWithSignature(
user_model.ValidateCommitsWithEmails(commits),
- repo,
+ repo.GetTrustModel(),
+ func(user *user_model.User) (bool, error) {
+ return IsUserRepoAdmin(repo, user)
+ },
),
repo,
)