From 684d36068dc282e7bca05677b7e2e23edaca9949 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 18 May 2020 12:45:07 +0200 Subject: pkg/vcs: always extract tags from subject --- pkg/vcs/git.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'pkg/vcs/git.go') diff --git a/pkg/vcs/git.go b/pkg/vcs/git.go index 27064de7b..a6982aba0 100644 --- a/pkg/vcs/git.go +++ b/pkg/vcs/git.go @@ -180,15 +180,6 @@ func (git *git) getCommit(commit string) (*Commit, error) { return gitParseCommit(output, nil, nil, git.ignoreCC) } -func isEmpty(lines [][]byte) bool { - for _, line := range lines { - if len(line) > 0 { - return false - } - } - return true -} - func gitParseCommit(output, user, domain []byte, ignoreCC map[string]bool) (*Commit, error) { lines := bytes.Split(output, []byte{'\n'}) if len(lines) < 4 || len(lines[0]) != 40 { @@ -202,12 +193,8 @@ func gitParseCommit(output, user, domain []byte, ignoreCC map[string]bool) (*Com cc := make(map[string]bool) cc[strings.ToLower(string(lines[2]))] = true var tags []string - bodyLines := lines[6:] - if isEmpty(bodyLines) { - // Body is empty, use summary instead. - bodyLines = [][]byte{lines[1]} - } - for _, line := range bodyLines { + // Use summary line + all description lines. + for _, line := range append([][]byte{lines[1]}, lines[6:]...) { if user != nil { userPos := bytes.Index(line, user) if userPos != -1 { -- cgit mrf-deployment