MCPcopy Create free account
hub / github.com/go-git/go-git / scanExtraCont

Function scanExtraCont

plumbing/object/commit_scanner.go:310–328  ·  view source on GitHub ↗

scanExtraCont accumulates continuation lines for an unknown ExtraHeader whose value spans multiple lines, then finalises the entry once the continuation block ends.

(s *commitScanner)

Source from the content-addressed store, hash-verified

308// whose value spans multiple lines, then finalises the entry once the
309// continuation block ends.
310func 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
330func (s *commitScanner) finaliseExtra() {
331 s.extra.Value = strings.TrimRight(s.extra.Value, "\n")

Callers

nothing calls this directly

Calls 3

finaliseExtraMethod · 0.80
readLineMethod · 0.45
pushBackMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…