diff options
Diffstat (limited to 'internal/db/user.go')
-rw-r--r-- | internal/db/user.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/internal/db/user.go b/internal/db/user.go index 17e0f66b..5be64668 100644 --- a/internal/db/user.go +++ b/internal/db/user.go @@ -5,7 +5,6 @@ package db import ( - "context" "fmt" _ "image/jpeg" "os" @@ -14,8 +13,6 @@ import ( log "unknwon.dev/clog/v2" "xorm.io/xorm" - "github.com/gogs/git-module" - "gogs.io/gogs/internal/repoutil" "gogs.io/gogs/internal/userutil" ) @@ -200,33 +197,6 @@ func DeleteInactivateUsers() (err error) { return err } -// UserCommit represents a commit with validation of user. -type UserCommit struct { - User *User - *git.Commit -} - -// ValidateCommitsWithEmails checks if authors' e-mails of commits are corresponding to users. -func ValidateCommitsWithEmails(oldCommits []*git.Commit) []*UserCommit { - emails := make(map[string]*User) - newCommits := make([]*UserCommit, len(oldCommits)) - for i := range oldCommits { - var u *User - if v, ok := emails[oldCommits[i].Author.Email]; !ok { - u, _ = Users.GetByEmail(context.TODO(), oldCommits[i].Author.Email) - emails[oldCommits[i].Author.Email] = u - } else { - u = v - } - - newCommits[i] = &UserCommit{ - User: u, - Commit: oldCommits[i], - } - } - return newCommits -} - // GetRepositoryAccesses finds all repositories with their access mode where a user has access but does not own. func (u *User) GetRepositoryAccesses() (map[*Repository]AccessMode, error) { accesses := make([]*Access, 0, 10) |