mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-23 15:58:30 -04:00
remove util.OptionalBool and related functions (#29513)
and migrate affected code _last refactoring bits to replace **util.OptionalBool** with **optional.Option[bool]**_ (cherry picked from commit a3f05d0d98408bb47333b19f505b21afcefa9e7c) Conflicts: services/repository/branch.go trivial context conflict
This commit is contained in:
parent
be9189eddc
commit
e2371743d5
71 changed files with 308 additions and 355 deletions
|
@ -23,7 +23,6 @@ import (
|
|||
"code.gitea.io/gitea/modules/queue"
|
||||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
notify_service "code.gitea.io/gitea/services/notify"
|
||||
files_service "code.gitea.io/gitea/services/repository/files"
|
||||
|
||||
|
@ -52,7 +51,7 @@ type Branch struct {
|
|||
}
|
||||
|
||||
// LoadBranches loads branches from the repository limited by page & pageSize.
|
||||
func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git.Repository, isDeletedBranch util.OptionalBool, keyword string, page, pageSize int) (*Branch, []*Branch, int64, error) {
|
||||
func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git.Repository, isDeletedBranch optional.Option[bool], keyword string, page, pageSize int) (*Branch, []*Branch, int64, error) {
|
||||
defaultDBBranch, err := git_model.GetBranch(ctx, repo.ID, repo.DefaultBranch)
|
||||
if err != nil {
|
||||
return nil, nil, 0, err
|
||||
|
@ -60,7 +59,7 @@ func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git
|
|||
|
||||
branchOpts := git_model.FindBranchOptions{
|
||||
RepoID: repo.ID,
|
||||
IsDeletedBranch: isDeletedBranch.ToGeneric(),
|
||||
IsDeletedBranch: isDeletedBranch,
|
||||
ListOptions: db.ListOptions{
|
||||
Page: page,
|
||||
PageSize: pageSize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue