scanExtraCont accumulates continuation lines for an unknown ExtraHeader whose value spans multiple lines, then finalises the entry once the continuation block ends.
(s *commitScanner)
| 308 | // whose value spans multiple lines, then finalises the entry once the |
| 309 | // continuation block ends. |
| 310 | func scanExtraCont(s *commitScanner) (commitState, error) { |
| 311 | line, err := s.readLine() |
| 312 | if err != nil && err != io.EOF { |
| 313 | return nil, err |
| 314 | } |
| 315 | if len(line) > 0 && line[0] == ' ' { |
| 316 | s.extra.Value += string(line[1:]) |
| 317 | if err == io.EOF { |
| 318 | s.finaliseExtra() |
| 319 | return nil, nil |
| 320 | } |
| 321 | return scanExtraCont, nil |
| 322 | } |
| 323 | s.finaliseExtra() |
| 324 | if len(line) > 0 { |
| 325 | s.pushBack(line, err) |
| 326 | } |
| 327 | return scanHeaders, nil |
| 328 | } |
| 329 | |
| 330 | func (s *commitScanner) finaliseExtra() { |
| 331 | s.extra.Value = strings.TrimRight(s.extra.Value, "\n") |
nothing calls this directly
no test coverage detected
searching dependent graphs…