From d7511c593542f13066d2d5744352cceb75376d9d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 25 Aug 2021 06:15:07 +0800 Subject: [PATCH] Fix branch pagination error (#16805) Fix #16801 Even if default branch is removed from the current page, but the total branches number should be still kept. So that the pagination calculation will be correct. --- routers/web/repo/branch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/branch.go b/routers/web/repo/branch.go index da72940144fe..dd099d478402 100644 --- a/routers/web/repo/branch.go +++ b/routers/web/repo/branch.go @@ -217,7 +217,7 @@ func loadBranches(ctx *context.Context, skip, limit int) ([]*Branch, int) { branches = append(branches, deletedBranches...) } - return branches, totalNumOfBranches - 1 + return branches, totalNumOfBranches } func loadOneBranch(ctx *context.Context, rawBranch *git.Branch, protectedBranches []*models.ProtectedBranch,