From fa27800311f78fe080db1234bfda601928e3ca26 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 19 Dec 2018 18:10:41 -0500 Subject: [PATCH] Fix check bug where versions were being missed --- gitlab.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gitlab.go b/gitlab.go index 2fd8065..33250a4 100644 --- a/gitlab.go +++ b/gitlab.go @@ -85,13 +85,13 @@ func (g *GitlabClient) ListTags() ([]*gitlab.Tag, error) { return []*gitlab.Tag{}, err } + allTags = append(allTags, tags...) + if opt.Page >= res.TotalPages { break } opt.Page = res.NextPage - - allTags = append(allTags, tags...) } return allTags, nil @@ -115,10 +115,6 @@ func (g *GitlabClient) ListTagsUntil(tag_name string) ([]*gitlab.Tag, error) { return []*gitlab.Tag{}, err } - if opt.Page >= res.TotalPages { - break - } - foundTag := false for i, tag := range tags { if tag.Name == tag_name { @@ -130,9 +126,13 @@ func (g *GitlabClient) ListTagsUntil(tag_name string) ([]*gitlab.Tag, error) { if foundTag { break } + allTags = append(allTags, tags...) + + if opt.Page >= res.TotalPages { + break + } opt.Page = res.NextPage - allTags = append(allTags, tags...) } return allTags, nil