summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/context/repo.go6
-rw-r--r--modules/repository/branch.go8
2 files changed, 5 insertions, 9 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
diff --git a/modules/repository/branch.go b/modules/repository/branch.go
index 8daceecb44..cd45f16227 100644
--- a/modules/repository/branch.go
+++ b/modules/repository/branch.go
@@ -49,11 +49,9 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
dbBranches := make(map[string]*git_model.Branch)
{
- branches, err := git_model.FindBranches(ctx, git_model.FindBranchOptions{
- ListOptions: db.ListOptions{
- ListAll: true,
- },
- RepoID: repo.ID,
+ branches, err := db.Find[git_model.Branch](ctx, git_model.FindBranchOptions{
+ ListOptions: db.ListOptionsAll,
+ RepoID: repo.ID,
})
if err != nil {
return 0, err