mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	remove util.OptionalBool and related functions (#29513)
and migrate affected code _last refactoring bits to replace **util.OptionalBool** with **optional.Option[bool]**_
This commit is contained in:
		@@ -24,7 +24,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"
 | 
			
		||||
	webhook_module "code.gitea.io/gitea/modules/webhook"
 | 
			
		||||
	notify_service "code.gitea.io/gitea/services/notify"
 | 
			
		||||
	files_service "code.gitea.io/gitea/services/repository/files"
 | 
			
		||||
@@ -54,7 +53,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
 | 
			
		||||
@@ -62,7 +61,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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user