diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-09-17 16:24:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-17 08:24:40 +0000 |
commit | 47b878858ada27fc4c74eeadcc1e467d2da90e04 (patch) | |
tree | 95486eeed5a8287a5c402b5e3c9023d83a3bebdc /services/repository/branch.go | |
parent | dcf4b9e3146db7bb8359538acb7c5fbd6fce9e6f (diff) | |
download | gitea-47b878858ada27fc4c74eeadcc1e467d2da90e04.tar.gz gitea-47b878858ada27fc4c74eeadcc1e467d2da90e04.zip |
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">
Diffstat (limited to 'services/repository/branch.go')
-rw-r--r-- | services/repository/branch.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/repository/branch.go b/services/repository/branch.go index 620e0b6c9f..011dc5568e 100644 --- a/services/repository/branch.go +++ b/services/repository/branch.go @@ -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) |