1
0
Fork 0
forked from forgejo/forgejo

Add directory level commit message

This commit is contained in:
Unknwon 2014-09-26 08:55:13 -04:00
parent 3164354255
commit b8368f98ff
6 changed files with 32 additions and 11 deletions

View file

@ -521,8 +521,17 @@ type UserCommit struct {
*git.Commit
}
// ValidCommitsWithEmails checks if authors' e-mails of commits are correcponding to users.
func ValidCommitsWithEmails(oldCommits *list.List) *list.List {
// ValidateCommitWithEmail chceck if author's e-mail of commit is corresponsind to a user.
func ValidateCommitWithEmail(c *git.Commit) (uname string) {
u, err := GetUserByEmail(c.Author.Email)
if err == nil {
uname = u.Name
}
return uname
}
// ValidateCommitsWithEmails checks if authors' e-mails of commits are corresponding to users.
func ValidateCommitsWithEmails(oldCommits *list.List) *list.List {
emails := map[string]string{}
newCommits := list.New()
e := oldCommits.Front()