mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-19 15:40:50 +00:00
Search branches (#27055)
Resolve #25233 <img width="1315" alt="图片" src="3ba59b58
-471a-4e1b-985c-87edac2268c0"> <img width="1297" alt="图片" src="b6caa12f
-323b-4f70-9c44-ef91cb71a26c">
This commit is contained in:
parent
dcf4b9e314
commit
47b878858a
5 changed files with 24 additions and 4 deletions
|
@ -66,7 +66,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, page, pageSize int) (*Branch, []*Branch, int64, error) {
|
||||
func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git.Repository, isDeletedBranch util.OptionalBool, 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
|
||||
|
@ -79,6 +79,7 @@ func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git
|
|||
Page: page,
|
||||
PageSize: pageSize,
|
||||
},
|
||||
Keyword: keyword,
|
||||
}
|
||||
|
||||
totalNumOfBranches, err := git_model.CountBranches(ctx, branchOpts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue