0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 08:22:55 +01:00

Page: Commits and fix #249

This commit is contained in:
Unknwon 2014-09-23 23:18:14 -04:00
parent 5bbeeb0f1b
commit bd55b78775

View file

@ -522,15 +522,21 @@ type UserCommit struct {
// ValidCommitsWithEmails checks if authors' e-mails of commits are correcponding to users.
func ValidCommitsWithEmails(oldCommits *list.List) *list.List {
emails := map[string]string{}
newCommits := list.New()
e := oldCommits.Front()
for e != nil {
c := e.Value.(*git.Commit)
uname := ""
u, err := GetUserByEmail(c.Author.Email)
if err == nil {
uname = u.Name
if v, ok := emails[c.Author.Email]; !ok {
u, err := GetUserByEmail(c.Author.Email)
if err == nil {
uname = u.Name
}
emails[c.Author.Email] = uname
} else {
uname = v
}
newCommits.PushBack(UserCommit{