MCPcopy Index your code
hub / github.com/go-git/go-git / encodeChunkHeaders

Method encodeChunkHeaders

plumbing/format/commitgraph/v2/encoder.go:124–140  ·  view source on GitHub ↗
(chunkSignatures [][]byte, chunkSizes []uint64)

Source from the content-addressed store, hash-verified

122}
123
124func (e *Encoder) encodeChunkHeaders(chunkSignatures [][]byte, chunkSizes []uint64) (err error) {
125 // 8 bytes of file header, 12 bytes for each chunk header and 12 byte for terminator
126 offset := uint64(szSignature + szHeader + (len(chunkSignatures)+1)*(szChunkSig+szUint64))
127 for i, signature := range chunkSignatures {
128 if _, err = e.Write(signature); err == nil {
129 err = binary.WriteUint64(e, offset)
130 }
131 if err != nil {
132 return
133 }
134 offset += chunkSizes[i]
135 }
136 if _, err = e.Write(ZeroChunk.Signature()); err == nil {
137 err = binary.WriteUint64(e, offset)
138 }
139 return
140}
141
142func (e *Encoder) encodeFanout(fanout []uint32) (err error) {
143 for i := 0; i <= 0xff; i++ {

Callers 1

EncodeMethod · 0.95

Calls 3

WriteUint64Function · 0.92
SignatureMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected