maintner: handle multi-line subject edge-case

This is a followup to CL 161222, where I forgot to handle the case
where a commit message has a multi-line subject and no body.

Updates golang/go#30101

Change-Id: I01222e8cf783bc3b0631a332cf379717aa85cebc
Reviewed-on: https://go-review.googlesource.com/c/161797
Reviewed-by: Andrew Bonventre <andybons@golang.org>
diff --git a/maintner/gerrit.go b/maintner/gerrit.go
index e28e4a8..b89609f 100644
--- a/maintner/gerrit.go
+++ b/maintner/gerrit.go
@@ -493,7 +493,7 @@
 	if i := strings.Index(cl.Commit.Msg, "\n\n"); i >= 0 {
 		return strings.Replace(cl.Commit.Msg[:i], "\n", " ", -1)
 	}
-	return cl.Commit.Msg
+	return strings.Replace(cl.Commit.Msg, "\n", " ", -1)
 }
 
 // CommitAtVersion returns the git commit of the specifid version of this CL.
diff --git a/maintner/gerrit_test.go b/maintner/gerrit_test.go
index 91822c5..4e973b3 100644
--- a/maintner/gerrit_test.go
+++ b/maintner/gerrit_test.go
@@ -230,6 +230,7 @@
 		{"maintner: slurp up all the things", "maintner: slurp up all the things"},
 		{"cmd/go: build stuff\n\nand do other stuff, too.", "cmd/go: build stuff"},
 		{"cmd/go: build lots\nof stuff\n\nand do other stuff, too.", "cmd/go: build lots of stuff"}, // Subject is separated from body by a blank line.
+		{"cmd/go: build lots\nof stuff", "cmd/go: build lots of stuff"},
 	}
 	for _, tc := range testcases {
 		cl := &GerritCL{Commit: &GitCommit{Msg: tc.msg}}