summaryrefslogtreecommitdiffstats
path: root/modules/base/tool.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-29 19:29:52 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-29 19:29:52 +0800
commita726c125b572bc1ff0b445990821280e304db9ff (patch)
tree96e6d27a4505f8f5a16ea086b227add575a87c50 /modules/base/tool.go
parentf48fc24670b122df069149801459eb55a67045c7 (diff)
downloadgitea-a726c125b572bc1ff0b445990821280e304db9ff.tar.gz
gitea-a726c125b572bc1ff0b445990821280e304db9ff.zip
Add PushCommit
Diffstat (limited to 'modules/base/tool.go')
-rw-r--r--modules/base/tool.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go
index 9ddb90f721..d005ffe355 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -506,9 +506,16 @@ const (
<div><img src="%s?s=16" alt="user-avatar"/> %s</div>`
)
+type PushCommit struct {
+ Sha1 string
+ Message string
+ AuthorEmail string
+ AuthorName string
+}
+
type PushCommits struct {
Len int
- Commits [][]string
+ Commits []*PushCommit
}
// ActionDesc accepts int that represents action operation type
@@ -529,7 +536,7 @@ func ActionDesc(act Actioner, avatarLink string) string {
}
buf := bytes.NewBuffer([]byte("\n"))
for _, commit := range push.Commits {
- buf.WriteString(fmt.Sprintf(TPL_COMMIT_REPO_LI, avatarLink, repoLink, commit[0], commit[0][:7], commit[1]) + "\n")
+ buf.WriteString(fmt.Sprintf(TPL_COMMIT_REPO_LI, avatarLink, repoLink, commit.Sha1, commit.Sha1[:7], commit.Message) + "\n")
}
if push.Len > 3 {
buf.WriteString(fmt.Sprintf(`<div><a href="/%s/%s/commits/%s">%d other commits >></a></div>`, actUserName, repoName, branch, push.Len))