Skip to content

Commit

Permalink
Merge pull request #316 from drone/IAC-2201
Browse files Browse the repository at this point in the history
fix: [IAC-2201]: fixed looping endless pagination
  • Loading branch information
vitsafronovici authored Jul 17, 2024
2 parents ecdc44a + be67dd5 commit efdcec6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion scm/driver/bitbucket/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ func (s *gitService) ListTags(ctx context.Context, repo string, opts scm.ListOpt
out := new(branches)
res, err := s.client.do(ctx, "GET", path, nil, &out)

copyPagination(out.pagination, res)

if res != nil {
res.Page.Next = 0
}

copyPagination(out.pagination, res)
return convertTagList(out), res, err
}

Expand Down
3 changes: 1 addition & 2 deletions scm/driver/bitbucket/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func TestGitListTags(t *testing.T) {
File("testdata/tags.json")

client, _ := New("https://api.bitbucket.org")
got, res, err := client.Git.ListTags(context.Background(), "atlassian/atlaskit", scm.ListOptions{Page: 1, Size: 30})
got, _, err := client.Git.ListTags(context.Background(), "atlassian/atlaskit", scm.ListOptions{Page: 1, Size: 30})
if err != nil {
t.Error(err)
}
Expand All @@ -264,7 +264,6 @@ func TestGitListTags(t *testing.T) {
t.Log(diff)
}

t.Run("Page", testPage(res))
}

func TestGitListChanges(t *testing.T) {
Expand Down

0 comments on commit efdcec6

Please sign in to comment.