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

Function NewEncoder

plumbing/format/index/encoder.go:32–36  ·  view source on GitHub ↗

NewEncoder returns a new encoder that writes to w.

(w io.Writer)

Source from the content-addressed store, hash-verified

30
31// NewEncoder returns a new encoder that writes to w.
32func NewEncoder(w io.Writer) *Encoder {
33 h := hash.New(hash.CryptoType)
34 mw := io.MultiWriter(w, h)
35 return &Encoder{mw, h, nil}
36}
37
38// Encode writes the Index to the stream of the encoder.
39func (e *Encoder) Encode(idx *Index) error {

Callers 13

SetIndexMethod · 0.92
TestEncodeMethod · 0.70
TestEncodeLongNameFunction · 0.70
TestEncodeV4Function · 0.70
TestDecodeInvalidHashMethod · 0.70
TestDecodeV4StripLengthFunction · 0.70

Calls 1

NewFunction · 0.92

Used in the wild real call sites across dependent graphs

searching dependent graphs…