mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 15:27:46 +01:00
Fix branch list bug which displayed default branch twice (#28878)
Fix #28876
This commit is contained in:
parent
49d7663929
commit
0e6fd0d1c1
1 changed files with 2 additions and 3 deletions
|
@ -65,7 +65,8 @@ func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git
|
||||||
Page: page,
|
Page: page,
|
||||||
PageSize: pageSize,
|
PageSize: pageSize,
|
||||||
},
|
},
|
||||||
Keyword: keyword,
|
Keyword: keyword,
|
||||||
|
ExcludeBranchNames: []string{repo.DefaultBranch},
|
||||||
}
|
}
|
||||||
|
|
||||||
dbBranches, totalNumOfBranches, err := db.FindAndCount[git_model.Branch](ctx, branchOpts)
|
dbBranches, totalNumOfBranches, err := db.FindAndCount[git_model.Branch](ctx, branchOpts)
|
||||||
|
@ -73,8 +74,6 @@ func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git
|
||||||
return nil, nil, 0, err
|
return nil, nil, 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
branchOpts.ExcludeBranchNames = []string{repo.DefaultBranch}
|
|
||||||
|
|
||||||
if err := git_model.BranchList(dbBranches).LoadDeletedBy(ctx); err != nil {
|
if err := git_model.BranchList(dbBranches).LoadDeletedBy(ctx); err != nil {
|
||||||
return nil, nil, 0, err
|
return nil, nil, 0, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue