MCPcopy Create free account
hub / github.com/go-git/go-git / NewEncoder

Function NewEncoder

plumbing/format/commitgraph/encoder.go:25–29  ·  view source on GitHub ↗

NewEncoder returns a new stream encoder that writes to w. Deprecated: This package uses the wrong types for Generation and Index in CommitData. Use the v2 package instead.

(w io.Writer)

Source from the content-addressed store, hash-verified

23// Deprecated: This package uses the wrong types for Generation and Index in CommitData.
24// Use the v2 package instead.
25func NewEncoder(w io.Writer) *Encoder {
26 h := hash.New(hash.CryptoType)
27 mw := io.MultiWriter(w, h)
28 return &Encoder{mw, h}
29}
30
31// Encode writes an index into the commit-graph file
32//

Callers 2

TestReencodeMethod · 0.92
TestReencodeInMemoryMethod · 0.92

Calls 1

NewFunction · 0.92

Tested by 2

TestReencodeMethod · 0.74
TestReencodeInMemoryMethod · 0.74