mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09:00
Backport of #21400 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
Lunny Xiao
parent
46053c092d
commit
5a84558e7c
@@ -124,11 +124,11 @@ func (m *MSTeamsPayload) Push(p *api.PushPayload) (api.Payloader, error) {
|
||||
)
|
||||
|
||||
var titleLink string
|
||||
if len(p.Commits) == 1 {
|
||||
if p.TotalCommits == 1 {
|
||||
commitDesc = "1 new commit"
|
||||
titleLink = p.Commits[0].URL
|
||||
} else {
|
||||
commitDesc = fmt.Sprintf("%d new commits", len(p.Commits))
|
||||
commitDesc = fmt.Sprintf("%d new commits", p.TotalCommits)
|
||||
titleLink = p.CompareURL
|
||||
}
|
||||
if titleLink == "" {
|
||||
@@ -155,7 +155,7 @@ func (m *MSTeamsPayload) Push(p *api.PushPayload) (api.Payloader, error) {
|
||||
text,
|
||||
titleLink,
|
||||
greenColor,
|
||||
&MSTeamsFact{"Commit count:", fmt.Sprintf("%d", len(p.Commits))},
|
||||
&MSTeamsFact{"Commit count:", fmt.Sprintf("%d", p.TotalCommits)},
|
||||
), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user