From ab7e36e3a5b88a364e57fe11aa7fc5de0648a4fe Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 25 Aug 2021 18:11:54 +0800 Subject: [PATCH] Fix branch pagination error (#16805) (#16816) Backport #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 da72940144fef..dd099d4784025 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,