aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs/linux.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-10-15 09:47:17 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-10-21 10:22:10 +0200
commite2605999d9d1fa4e98bcf850ed007cfd98f27383 (patch)
treed87623db89fd2db41621f1041de4b6674ac84f55 /pkg/vcs/linux.go
parentff4a3345a1b2a40ff1b8b983153d0b1fcc72f1c5 (diff)
pkg/vcs: add ReleaseTag
Add ReleaseTag method that returns last release tag for the given commit. Update #2171
Diffstat (limited to 'pkg/vcs/linux.go')
-rw-r--r--pkg/vcs/linux.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/vcs/linux.go b/pkg/vcs/linux.go
index 8e4f17d4a..c4e2a90a5 100644
--- a/pkg/vcs/linux.go
+++ b/pkg/vcs/linux.go
@@ -39,7 +39,7 @@ func newLinux(dir string) *linux {
}
func (ctx *linux) PreviousReleaseTags(commit string) ([]string, error) {
- tags, err := ctx.git.previousReleaseTags(commit, false)
+ tags, err := ctx.git.previousReleaseTags(commit, false, false)
if err != nil {
return nil, err
}
@@ -71,7 +71,7 @@ func (ctx *linux) PreviousReleaseTags(commit string) ([]string, error) {
return tags, nil
}
-func gitParseReleaseTags(output []byte) ([]string, error) {
+func gitParseReleaseTags(output []byte) []string {
var tags []string
for _, tag := range bytes.Split(output, []byte{'\n'}) {
if releaseTagRe.Match(tag) && gitReleaseTagToInt(string(tag)) != 0 {
@@ -81,7 +81,7 @@ func gitParseReleaseTags(output []byte) ([]string, error) {
sort.Slice(tags, func(i, j int) bool {
return gitReleaseTagToInt(tags[i]) > gitReleaseTagToInt(tags[j])
})
- return tags, nil
+ return tags
}
func gitReleaseTagToInt(tag string) uint64 {
@@ -105,7 +105,7 @@ func gitReleaseTagToInt(tag string) uint64 {
}
func (ctx *linux) EnvForCommit(binDir, commit string, kernelConfig []byte) (*BisectEnv, error) {
- tagList, err := ctx.previousReleaseTags(commit, true)
+ tagList, err := ctx.previousReleaseTags(commit, true, false)
if err != nil {
return nil, err
}