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

Function NewDecoder

plumbing/format/index/decoder.go:53–62  ·  view source on GitHub ↗

NewDecoder returns a new decoder that reads from r.

(r io.Reader)

Source from the content-addressed store, hash-verified

51
52// NewDecoder returns a new decoder that reads from r.
53func NewDecoder(r io.Reader) *Decoder {
54 h := hash.New(hash.CryptoType)
55 buf := bufio.NewReader(r)
56 return &Decoder{
57 buf: buf,
58 r: io.TeeReader(buf, h),
59 hash: h,
60 extReader: bufio.NewReader(nil),
61 }
62}
63
64// Decode reads the whole index object from its input and stores it in the
65// value pointed to by idx.

Callers 15

IndexMethod · 0.92
TestEncodeMethod · 0.70
TestEncodeLongNameFunction · 0.70
TestEncodeV4Function · 0.70
TestDecodeMethod · 0.70
TestDecodeEntriesMethod · 0.70
TestDecodeCacheTreeMethod · 0.70
TestDecodeExtendedV3Method · 0.70
TestDecodeResolveUndoMethod · 0.70

Calls 1

NewFunction · 0.92

Tested by 15

TestEncodeMethod · 0.56
TestEncodeLongNameFunction · 0.56
TestEncodeV4Function · 0.56
TestDecodeMethod · 0.56
TestDecodeEntriesMethod · 0.56
TestDecodeCacheTreeMethod · 0.56
TestDecodeExtendedV3Method · 0.56
TestDecodeResolveUndoMethod · 0.56
TestDecodeV4Method · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…