From 4e761fa38584d3d9f9a607bcee806fc24d142277 Mon Sep 17 00:00:00 2001
From: Lunny Xiao <xiaolunwen@gmail.com>
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 84c3864669..32cfc2adff 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,