scanMessage drains the remaining bytes into the message buffer.
(s *commitScanner)
| 335 | |
| 336 | // scanMessage drains the remaining bytes into the message buffer. |
| 337 | func scanMessage(s *commitScanner) (commitState, error) { |
| 338 | for { |
| 339 | line, err := s.readLine() |
| 340 | if err != nil && err != io.EOF { |
| 341 | return nil, err |
| 342 | } |
| 343 | if len(line) > 0 { |
| 344 | s.msgbuf.Write(line) |
| 345 | } |
| 346 | if err == io.EOF { |
| 347 | return nil, nil |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | // isBlankLine reports whether line is the canonical header/body separator: |
| 353 | // a single newline. Mirrors upstream's `*line == '\n'` test in |