(m string)
| 410 | } |
| 411 | |
| 412 | func splitMessage(m string) (title string, body string) { |
| 413 | s := bufio.NewScanner(strings.NewReader(m)) |
| 414 | |
| 415 | var b strings.Builder |
| 416 | for s.Scan() { |
| 417 | line := s.Text() |
| 418 | if strings.TrimSpace(line) == "" && title == "" { |
| 419 | title = b.String() |
| 420 | b.Reset() |
| 421 | } else { |
| 422 | if b.Len() > 0 { |
| 423 | b.WriteByte('\n') |
| 424 | } |
| 425 | b.WriteString(line) |
| 426 | } |
| 427 | } |
| 428 | if s.Err() != nil { |
| 429 | return m, "" |
| 430 | } |
| 431 | |
| 432 | if title == "" { |
| 433 | return b.String(), "" |
| 434 | } |
| 435 | return title, b.String() |
| 436 | } |
| 437 | |
| 438 | func fillHeader(h *gitdiff.PatchHeader, patchFile, message string) *gitdiff.PatchHeader { |
| 439 | if h == nil { |
no test coverage detected