mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -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",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user