Fix check bug where versions were being missed

This commit is contained in:
Ed
2018-12-19 18:10:41 -05:00
parent 9eb0ab0a0f
commit fa27800311

View File

@@ -85,13 +85,13 @@ func (g *GitlabClient) ListTags() ([]*gitlab.Tag, error) {
return []*gitlab.Tag{}, err return []*gitlab.Tag{}, err
} }
allTags = append(allTags, tags...)
if opt.Page >= res.TotalPages { if opt.Page >= res.TotalPages {
break break
} }
opt.Page = res.NextPage opt.Page = res.NextPage
allTags = append(allTags, tags...)
} }
return allTags, nil return allTags, nil
@@ -115,10 +115,6 @@ func (g *GitlabClient) ListTagsUntil(tag_name string) ([]*gitlab.Tag, error) {
return []*gitlab.Tag{}, err return []*gitlab.Tag{}, err
} }
if opt.Page >= res.TotalPages {
break
}
foundTag := false foundTag := false
for i, tag := range tags { for i, tag := range tags {
if tag.Name == tag_name { if tag.Name == tag_name {
@@ -130,9 +126,13 @@ func (g *GitlabClient) ListTagsUntil(tag_name string) ([]*gitlab.Tag, error) {
if foundTag { if foundTag {
break break
} }
allTags = append(allTags, tags...)
if opt.Page >= res.TotalPages {
break
}
opt.Page = res.NextPage opt.Page = res.NextPage
allTags = append(allTags, tags...)
} }
return allTags, nil return allTags, nil