We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 76e8cce + edf5c0c commit 59330e2Copy full SHA for 59330e2
repo_tag.go
@@ -102,6 +102,18 @@ func (repo *Repository) GetTags() ([]string, error) {
102
if err != nil {
103
return nil, err
104
}
105
- tags := strings.Split(stdout, "\n")
106
- return tags[:len(tags)-1], nil
+
+ tags := strings.Split(strings.TrimSpace(stdout), "\n")
107
108
+ if version.Compare(gitVersion, "2.0.0", "<") {
109
+ version.Sort(tags)
110
111
+ // Reverse order
112
+ for i := 0; i < len(tags) / 2; i++ {
113
+ j := len(tags) - i - 1
114
+ tags[i], tags[j] = tags[j], tags[i]
115
+ }
116
117
118
+ return tags, nil
119
0 commit comments