aboutsummaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-12-11 16:56:48 +0800
committerGitHub <noreply@github.com>2023-12-11 16:56:48 +0800
commit537fa6996214ef42348cfe89bab6f2e04380aeac (patch)
tree2b1d7a5b05b5da1c2cd30f400fd3ca648729c6f5 /modules/context
parent0abb5633e34fd14c2d49de0b4c98f7ba7d98a37e (diff)
downloadgitea-537fa6996214ef42348cfe89bab6f2e04380aeac.tar.gz
gitea-537fa6996214ef42348cfe89bab6f2e04380aeac.zip
Second part of refactor `db.Find` (#28194)
Continue of #27798 and move more functions to `db.Find` and `db.Count`.
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/repo.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index f91dd6aa9a..a18dc873b6 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -668,11 +668,9 @@ func RepoAssignment(ctx *Context) context.CancelFunc {
branchOpts := git_model.FindBranchOptions{
RepoID: ctx.Repo.Repository.ID,
IsDeletedBranch: util.OptionalBoolFalse,
- ListOptions: db.ListOptions{
- ListAll: true,
- },
+ ListOptions: db.ListOptionsAll,
}
- branchesTotal, err := git_model.CountBranches(ctx, branchOpts)
+ branchesTotal, err := db.Count[git_model.Branch](ctx, branchOpts)
if err != nil {
ctx.ServerError("CountBranches", err)
return cancel