You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

commit.go 810B

1234567891011121314151617181920212223242526
  1. // Copyright 2021 Gitea. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import (
  6. asymkey_model "code.gitea.io/gitea/models/asymkey"
  7. repo_model "code.gitea.io/gitea/models/repo"
  8. user_model "code.gitea.io/gitea/models/user"
  9. "code.gitea.io/gitea/modules/git"
  10. )
  11. // ConvertFromGitCommit converts git commits into SignCommitWithStatuses
  12. func ConvertFromGitCommit(commits []*git.Commit, repo *repo_model.Repository) []*SignCommitWithStatuses {
  13. return ParseCommitsWithStatus(
  14. asymkey_model.ParseCommitsWithSignature(
  15. user_model.ValidateCommitsWithEmails(commits),
  16. repo.GetTrustModel(),
  17. func(user *user_model.User) (bool, error) {
  18. return IsOwnerMemberCollaborator(repo, user.ID)
  19. },
  20. ),
  21. repo,
  22. )
  23. }