MCPcopy Create free account
hub / github.com/antonmedv/gitmal / applyTextLine

Function applyTextLine

pkg/gitdiff/apply_text.go:134–142  ·  view source on GitHub ↗
(dst io.Writer, line Line, preimage [][]byte, i int64)

Source from the content-addressed store, hash-verified

132}
133
134func applyTextLine(dst io.Writer, line Line, preimage [][]byte, i int64) (err error) {
135 if line.Old() && string(preimage[i]) != line.Line {
136 return &Conflict{"fragment line does not match src line"}
137 }
138 if line.New() {
139 _, err = io.WriteString(dst, line.Line)
140 }
141 return err
142}
143
144// Close writes any data following the last applied fragment and prevents
145// future calls to ApplyFragment.

Callers 1

ApplyFragmentMethod · 0.85

Calls 3

OldMethod · 0.80
NewMethod · 0.80
WriteStringMethod · 0.80

Tested by

no test coverage detected