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

Function writeTestObjectHeader

plumbing/format/packfile/internal_test.go:112–129  ·  view source on GitHub ↗
(w io.ByteWriter, typ plumbing.ObjectType, size int64)

Source from the content-addressed store, hash-verified

110}
111
112func writeTestObjectHeader(w io.ByteWriter, typ plumbing.ObjectType, size int64) {
113 remaining := uint64(size)
114 first := byte(typ)<<4 | byte(remaining&0x0f)
115 remaining >>= 4
116 if remaining > 0 {
117 first |= 0x80
118 }
119 _ = w.WriteByte(first)
120
121 for remaining > 0 {
122 next := byte(remaining & 0x7f)
123 remaining >>= 7
124 if remaining > 0 {
125 next |= 0x80
126 }
127 _ = w.WriteByte(next)
128 }
129}
130
131func zlibCompress(t *testing.T, content []byte) []byte {
132 t.Helper()

Callers 1

buildTestPackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…