diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-10-16 18:22:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 00:22:34 +0800 |
commit | cad9adeff41595ea32281dbc2918e653c3e3a839 (patch) | |
tree | a62bf796f12655c85323ded8922c6ea1d5e256ed /services/webhook/general_test.go | |
parent | 6f48a36227b7427afd2020aa416afe49d4c81015 (diff) | |
download | gitea-cad9adeff41595ea32281dbc2918e653c3e3a839.tar.gz gitea-cad9adeff41595ea32281dbc2918e653c3e3a839.zip |
Display total commit count in hook message (#21400)
Fixes #21379
The commits are capped by `setting.UI.FeedMaxCommitNum` so
`len(commits)` is not the correct number. So this PR adds a new
`TotalCommits` field.
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/webhook/general_test.go')
-rw-r--r-- | services/webhook/general_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/services/webhook/general_test.go b/services/webhook/general_test.go index 4acf51ac71..da3123d3ab 100644 --- a/services/webhook/general_test.go +++ b/services/webhook/general_test.go @@ -82,12 +82,13 @@ func pushTestPayload() *api.PushPayload { } return &api.PushPayload{ - Ref: "refs/heads/test", - Before: "2020558fe2e34debb818a514715839cabd25e777", - After: "2020558fe2e34debb818a514715839cabd25e778", - CompareURL: "", - HeadCommit: commit, - Commits: []*api.PayloadCommit{commit, commit}, + Ref: "refs/heads/test", + Before: "2020558fe2e34debb818a514715839cabd25e777", + After: "2020558fe2e34debb818a514715839cabd25e778", + CompareURL: "", + HeadCommit: commit, + Commits: []*api.PayloadCommit{commit, commit}, + TotalCommits: 2, Repo: &api.Repository{ HTMLURL: "http://localhost:3000/test/repo", Name: "repo", |