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

Function NewUnifiedEncoder

plumbing/format/diff/unified_encoder.go:50–57  ·  view source on GitHub ↗

NewUnifiedEncoder returns a new UnifiedEncoder that writes to w.

(w io.Writer, contextLines int)

Source from the content-addressed store, hash-verified

48
49// NewUnifiedEncoder returns a new UnifiedEncoder that writes to w.
50func NewUnifiedEncoder(w io.Writer, contextLines int) *UnifiedEncoder {
51 return &UnifiedEncoder{
52 Writer: w,
53 srcPrefix: "a/",
54 dstPrefix: "b/",
55 contextLines: contextLines,
56 }
57}
58
59// SetColor sets e's color configuration and returns e.
60func (e *UnifiedEncoder) SetColor(colorConfig ColorConfig) *UnifiedEncoder {

Callers 4

TestBothFilesEmptyMethod · 0.85
TestBinaryFileMethod · 0.85
TestEncodeMethod · 0.85

Calls

no outgoing calls

Tested by 4

TestBothFilesEmptyMethod · 0.68
TestBinaryFileMethod · 0.68
TestEncodeMethod · 0.68