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

Method encodeChunkHeaders

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

Source from the content-addressed store, hash-verified

108}
109
110func (e *Encoder) encodeChunkHeaders(chunkSignatures [][]byte, chunkSizes []uint64) (err error) {
111 // 8 bytes of file header, 12 bytes for each chunk header and 12 byte for terminator
112 offset := uint64(8 + len(chunkSignatures)*12 + 12)
113 for i, signature := range chunkSignatures {
114 if _, err = e.Write(signature); err == nil {
115 err = binary.WriteUint64(e, offset)
116 }
117 if err != nil {
118 return
119 }
120 offset += chunkSizes[i]
121 }
122 if _, err = e.Write(lastSignature); err == nil {
123 err = binary.WriteUint64(e, offset)
124 }
125 return
126}
127
128func (e *Encoder) encodeFanout(fanout []uint32) (err error) {
129 for i := 0; i <= 0xff; i++ {

Callers 1

EncodeMethod · 0.95

Calls 2

WriteUint64Function · 0.92
WriteMethod · 0.45

Tested by

no test coverage detected