mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-19 15:40:50 +00:00
Start to migrate from util.OptionalBool
to optional.Option[bool]
(#29329)
just create transition helper and migrate two structs (cherry picked from commit 7fbdb60fc1152acc9a040dc04b1b0f5a3475b081)
This commit is contained in:
parent
4b494d341f
commit
8ff858b94b
24 changed files with 84 additions and 64 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/gitrepo"
|
||||
"code.gitea.io/gitea/modules/graceful"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/optional"
|
||||
"code.gitea.io/gitea/modules/queue"
|
||||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
@ -59,7 +60,7 @@ func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git
|
|||
|
||||
branchOpts := git_model.FindBranchOptions{
|
||||
RepoID: repo.ID,
|
||||
IsDeletedBranch: isDeletedBranch,
|
||||
IsDeletedBranch: isDeletedBranch.ToGeneric(),
|
||||
ListOptions: db.ListOptions{
|
||||
Page: page,
|
||||
PageSize: pageSize,
|
||||
|
@ -243,7 +244,7 @@ func syncBranchToDB(ctx context.Context, repoID, pusherID int64, branchName stri
|
|||
// we cannot simply insert the branch but need to check we have branches or not
|
||||
hasBranch, err := db.Exist[git_model.Branch](ctx, git_model.FindBranchOptions{
|
||||
RepoID: repoID,
|
||||
IsDeletedBranch: util.OptionalBoolFalse,
|
||||
IsDeletedBranch: optional.Some(false),
|
||||
}.ToConds())
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue