mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 20:17:21 +00:00
Search branches (#27055)
Resolve #25233 <img width="1315" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/3ba59b58-471a-4e1b-985c-87edac2268c0"> <img width="1297" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/b6caa12f-323b-4f70-9c44-ef91cb71a26c">
This commit is contained in:
@ -70,6 +70,7 @@ type FindBranchOptions struct {
|
||||
ExcludeBranchNames []string
|
||||
IsDeletedBranch util.OptionalBool
|
||||
OrderBy string
|
||||
Keyword string
|
||||
}
|
||||
|
||||
func (opts *FindBranchOptions) Cond() builder.Cond {
|
||||
@ -84,6 +85,9 @@ func (opts *FindBranchOptions) Cond() builder.Cond {
|
||||
if !opts.IsDeletedBranch.IsNone() {
|
||||
cond = cond.And(builder.Eq{"is_deleted": opts.IsDeletedBranch.IsTrue()})
|
||||
}
|
||||
if opts.Keyword != "" {
|
||||
cond = cond.And(builder.Like{"name", opts.Keyword})
|
||||
}
|
||||
return cond
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user