From ba6baff6966f94a95243b02326add57335de5ef5 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 26 Aug 2021 00:04:58 +0100 Subject: Report the correct number of pushes on the feeds (#16811) * Report the correct number of pushes on the feeds Since the number of commits in the Action table has been limited to 5 the number of commits reported on the feeds page is now incorrectly also limited to 5. The correct number is available as the Len and this PR changes this to report this. Fix #16804 Signed-off-by: Andrew Thornton * Update templates/user/dashboard/feeds.tmpl Co-authored-by: techknowlogick --- modules/repository/commits.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'modules/repository') diff --git a/modules/repository/commits.go b/modules/repository/commits.go index 7f22105745..1558d85639 100644 --- a/modules/repository/commits.go +++ b/modules/repository/commits.go @@ -30,6 +30,7 @@ type PushCommits struct { Commits []*PushCommit HeadCommit *PushCommit CompareURL string + Len int avatars map[string]string emailUsers map[string]*models.User @@ -180,5 +181,12 @@ func GitToPushCommits(gitCommits []*git.Commit) *PushCommits { for _, commit := range gitCommits { commits = append(commits, CommitToPushCommit(commit)) } - return &PushCommits{commits, nil, "", make(map[string]string), make(map[string]*models.User)} + return &PushCommits{ + Commits: commits, + HeadCommit: nil, + CompareURL: "", + Len: len(commits), + avatars: make(map[string]string), + emailUsers: make(map[string]*models.User), + } } -- cgit v1.2.3