diff --git a/scm/driver/bitbucket/git.go b/scm/driver/bitbucket/git.go index 181c9fa3..e0ecc554 100644 --- a/scm/driver/bitbucket/git.go +++ b/scm/driver/bitbucket/git.go @@ -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 } diff --git a/scm/driver/bitbucket/git_test.go b/scm/driver/bitbucket/git_test.go index c04c26d5..e9349980 100644 --- a/scm/driver/bitbucket/git_test.go +++ b/scm/driver/bitbucket/git_test.go @@ -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) } @@ -264,7 +264,6 @@ func TestGitListTags(t *testing.T) { t.Log(diff) } - t.Run("Page", testPage(res)) } func TestGitListChanges(t *testing.T) {