1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-09 21:05:47 +00:00

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.
This commit is contained in:
Lunny Xiao 2021-08-25 18:11:54 +08:00 committed by GitHub
parent 63178b5654
commit ab7e36e3a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,