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

Function encodeInsertOperation

plumbing/format/packfile/diff_delta.go:138–159  ·  view source on GitHub ↗
(ibuf, buf *bytes.Buffer)

Source from the content-addressed store, hash-verified

136}
137
138func encodeInsertOperation(ibuf, buf *bytes.Buffer) {
139 if ibuf.Len() == 0 {
140 return
141 }
142
143 b := ibuf.Bytes()
144 s := ibuf.Len()
145 o := 0
146 for {
147 if s <= 127 {
148 break
149 }
150 buf.WriteByte(byte(127))
151 buf.Write(b[o : o+127])
152 s -= 127
153 o += 127
154 }
155 buf.WriteByte(byte(s))
156 buf.Write(b[o : o+s])
157
158 ibuf.Reset()
159}
160
161func deltaEncodeSize(size int) []byte {
162 var ret []byte

Callers 1

diffDeltaFunction · 0.85

Calls 4

LenMethod · 0.45
BytesMethod · 0.45
WriteMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…