From 026e745b9e3737655189b4c351b43133574235dd Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 14 Jul 2023 05:32:43 -0400 Subject: [PATCH] Fix incorrect release count (#25879) (#25887) Backport #25879 by @yp05327 Release count is not correct: https://try.gitea.io/yp05327/testrepo/tags ![image](https://github.com/go-gitea/gitea/assets/18380374/07f97c62-d450-4ccb-b3f2-3e0af9d9fc52) https://try.gitea.io/yp05327/testrepo/releases ![image](https://github.com/go-gitea/gitea/assets/18380374/6f1d55a4-bb68-445d-84b9-90552a40f403) https://try.gitea.io/yp05327/testrepo/releases/tag/testtag ![image](https://github.com/go-gitea/gitea/assets/18380374/09ab5d51-52b6-4621-a571-3100198eb260) We already have correct release count, no need to calculate it again. https://github.com/go-gitea/gitea/blob/c5e187c389b35b9e080a3187b93a775a3c81e585/modules/context/repo.go#L547 Co-authored-by: yp05327 <576951401@qq.com> --- routers/web/repo/release.go | 1 - templates/repo/release_tag_header.tmpl | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go index 0b927a3a2f..8dc78079e2 100644 --- a/routers/web/repo/release.go +++ b/routers/web/repo/release.go @@ -196,7 +196,6 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { } ctx.Data["Releases"] = releases - ctx.Data["ReleasesNum"] = len(releases) pager := context.NewPagination(int(count), opts.PageSize, opts.Page, 5) pager.SetDefaultParams(ctx) diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl index 7129e4235f..3f6f9aac31 100644 --- a/templates/repo/release_tag_header.tmpl +++ b/templates/repo/release_tag_header.tmpl @@ -5,7 +5,7 @@