mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-03 02:18:30 +02:00
Remove pagination from context (#807)
Pagination related flags now write directly to ListOption struct and enforce non negative numbers. Flag tests were added to cover the validation Reviewed-on: https://gitea.com/gitea/tea/pulls/807 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
@ -50,7 +50,7 @@ func RunBranchesList(_ stdctx.Context, cmd *cli.Command) error {
|
||||
var protections []*gitea.BranchProtection
|
||||
var err error
|
||||
branches, _, err = ctx.Login.Client().ListRepoBranches(owner, ctx.Repo, gitea.ListRepoBranchesOptions{
|
||||
ListOptions: ctx.GetListOptions(),
|
||||
ListOptions: flags.GetListOptions(),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
@ -58,7 +58,7 @@ func RunBranchesList(_ stdctx.Context, cmd *cli.Command) error {
|
||||
}
|
||||
|
||||
protections, _, err = ctx.Login.Client().ListBranchProtections(owner, ctx.Repo, gitea.ListBranchProtectionsOptions{
|
||||
ListOptions: ctx.GetListOptions(),
|
||||
ListOptions: flags.GetListOptions(),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user