aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-05-18 12:45:07 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-05-18 12:59:59 +0200
commit684d36068dc282e7bca05677b7e2e23edaca9949 (patch)
treedc387b0a987c06bc56fe08b0a39e13bbba956a10 /pkg
parent24d9114275cf8e2aa279feabd03c58f411f38a92 (diff)
pkg/vcs: always extract tags from subject
Diffstat (limited to 'pkg')
-rw-r--r--pkg/vcs/git.go17
-rw-r--r--pkg/vcs/git_repo_test.go10
2 files changed, 12 insertions, 15 deletions
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 {
diff --git a/pkg/vcs/git_repo_test.go b/pkg/vcs/git_repo_test.go
index ffdba7f9d..2e768a72d 100644
--- a/pkg/vcs/git_repo_test.go
+++ b/pkg/vcs/git_repo_test.go
@@ -285,6 +285,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: []string{userEmail},
tags: []string{"638dbf7851da8e255af5"},
},
+ {
+ description: `Reported-by: syzbot+3e3c7cfa8093f8de047e@my.mail.com
+
+Comment out an assertion that's now bogus and add a comment.
+`,
+ title: "Reported-by: syzbot+3e3c7cfa8093f8de047e@my.mail.com",
+ author: userEmail,
+ cc: []string{userEmail},
+ tags: []string{"3e3c7cfa8093f8de047e"},
+ },
}
func TestBisect(t *testing.T) {