diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-29 20:46:59 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-29 20:46:59 +0800 |
commit | 035facc5641e879b693982f6f4ada1d82915da82 (patch) | |
tree | 8ebe910503895aafacdc532efc61e94c48611106 /update.go | |
parent | f0d5c3992b03f4d6a82b272ac513d2989ffb8d81 (diff) | |
parent | ec1b801732b030648c060d26ce5a3ed8cf2e822c (diff) |
Merge branch 'master' of https://github.com/gogits/gogs
Diffstat (limited to 'update.go')
-rw-r--r-- | update.go | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -130,18 +130,26 @@ func runUpdate(c *cli.Context) { return } - commits := make([][]string, 0) + commits := make([]*base.PushCommit, 0) var maxCommits = 3 + var actEmail string for e := l.Front(); e != nil; e = e.Next() { commit := e.Value.(*git.Commit) - commits = append(commits, []string{commit.Id().String(), commit.Message()}) + if actEmail == "" { + actEmail = commit.Committer.Email + } + commits = append(commits, + &base.PushCommit{commit.Id().String(), + commit.Message(), + commit.Author.Email, + commit.Author.Name}) if len(commits) >= maxCommits { break } } //commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()}) - if err = models.CommitRepoAction(int64(sUserId), userName, + if err = models.CommitRepoAction(int64(sUserId), userName, actEmail, repos.Id, repoName, git.BranchName(refName), &base.PushCommits{l.Len(), commits}); err != nil { log.Error("runUpdate.models.CommitRepoAction: %v", err) } |