summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Muehlhaeuser <muesli@gmail.com>2021-12-17 23:00:27 +0100
committerChristian Muehlhaeuser <muesli@gmail.com>2021-12-17 23:22:18 +0100
commite49dc8a7d1ee92f48cc6e202c4ce3ea910d53b31 (patch)
treea8c9478dd5f56c2eb796cd694d198555955ebbb2
parent860d6d219b8dd89e4b69acb027a4c9c5e8704a8b (diff)
Fix GitLab paginationv0.4.1
GitLab starts counting at 1.
-rw-r--r--vcs/gitlab/gitlab.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/vcs/gitlab/gitlab.go b/vcs/gitlab/gitlab.go
index d6a4a60..2afde6f 100644
--- a/vcs/gitlab/gitlab.go
+++ b/vcs/gitlab/gitlab.go
@@ -59,7 +59,7 @@ func (c *Client) GetUsername() (string, error) {
func (c *Client) Issues(owner string, name string) ([]vcs.Issue, error) {
var i []vcs.Issue
- page := 0
+ page := 1
for {
issues, resp, err := c.api.Issues.ListProjectIssues(owner+"/"+name,
&gitlab.ListProjectIssuesOptions{
@@ -100,7 +100,7 @@ func (c *Client) Issues(owner string, name string) ([]vcs.Issue, error) {
func (c *Client) PullRequests(owner string, name string) ([]vcs.PullRequest, error) {
var i []vcs.PullRequest
- page := 0
+ page := 1
for {
prs, resp, err := c.api.MergeRequests.ListProjectMergeRequests(owner+"/"+name,
&gitlab.ListProjectMergeRequestsOptions{
@@ -151,7 +151,7 @@ func (c *Client) Repository(owner string, name string) (vcs.Repo, error) {
func (c *Client) Repositories(owner string) ([]vcs.Repo, error) {
var repos []vcs.Repo
- page := 0
+ page := 1
for {
p, resp, err := c.api.Groups.ListGroupProjects(owner, &gitlab.ListGroupProjectsOptions{
ListOptions: gitlab.ListOptions{
@@ -235,7 +235,7 @@ func (c *Client) Branches(owner string, name string) ([]vcs.Branch, error) {
func (c *Client) History(repo vcs.Repo, max int, since time.Time) ([]vcs.Commit, error) {
var commits []vcs.Commit
- page := 0
+ page := 1
for {
opt := gitlab.ListCommitsOptions{
ListOptions: gitlab.ListOptions{