]> source.dussan.org Git - gitea.git/commit
[API] Add pagination to ListBranches (#14524)
author6543 <6543@obermui.de>
Wed, 3 Feb 2021 19:06:13 +0000 (20:06 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Feb 2021 19:06:13 +0000 (20:06 +0100)
commit0d1444751f755c624ffb4c56cb0020ce7a083c77
treec00ab7d4a1b120f4fb4a70db134e5d712bef91ed
parentc295a27d4a8ef9a3a75280306e1ed94daa3b001d
[API] Add pagination to ListBranches (#14524)

* make PaginateUserSlice generic -> PaginateSlice

* Add pagination to ListBranches

* add skip, limit to Repository.GetBranches()

* Move routers/api/v1/utils/utils PaginateSlice -> modules/util/paginate.go

* repo_module.GetBranches paginate

* fix & rename & more logging

* better description

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: a1012112796 <1012112796@qq.com>
20 files changed:
integrations/branches_test.go
modules/context/repo.go
modules/git/repo_branch.go
modules/git/repo_branch_gogit.go
modules/git/repo_branch_nogogit.go
modules/git/repo_branch_test.go
modules/git/repo_tag_nogogit.go
modules/repository/branch.go
modules/repository/init.go
modules/util/paginate.go [new file with mode: 0644]
modules/util/paginate_test.go [new file with mode: 0644]
routers/api/v1/org/org.go
routers/api/v1/repo/branch.go
routers/api/v1/utils/utils.go
routers/repo/branch.go
routers/repo/compare.go
routers/repo/issue.go
services/mirror/mirror.go
services/pull/pull.go
templates/swagger/v1_json.tmpl