MCPcopy
hub / github.com/go-git/go-git / writeTo

Method writeTo

plumbing/format/diff/unified_encoder.go:384–395  ·  view source on GitHub ↗
(sb *strings.Builder, color ColorConfig)

Source from the content-addressed store, hash-verified

382}
383
384func (o *op) writeTo(sb *strings.Builder, color ColorConfig) {
385 colorKey := operationColorKey[o.t]
386 sb.WriteString(color[colorKey])
387 sb.WriteByte(operationChar[o.t])
388 if strings.HasSuffix(o.text, "\n") {
389 sb.WriteString(strings.TrimSuffix(o.text, "\n"))
390 } else {
391 sb.WriteString(o.text + "\n\\ No newline at end of file")
392 }
393 sb.WriteString(color.Reset(colorKey))
394 sb.WriteByte('\n')
395}

Callers 2

EncodeMethod · 0.45
writeToMethod · 0.45

Calls 1

ResetMethod · 0.45

Tested by

no test coverage detected