From e2605999d9d1fa4e98bcf850ed007cfd98f27383 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 15 Oct 2020 09:47:17 +0200 Subject: pkg/vcs: add ReleaseTag Add ReleaseTag method that returns last release tag for the given commit. Update #2171 --- pkg/vcs/linux.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/vcs/linux.go') 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 } -- cgit mrf-deployment