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

Function NewEncoder

plumbing/format/commitgraph/v2/encoder.go:20–24  ·  view source on GitHub ↗

NewEncoder returns a new stream encoder that writes to w.

(w io.Writer)

Source from the content-addressed store, hash-verified

18
19// NewEncoder returns a new stream encoder that writes to w.
20func NewEncoder(w io.Writer) *Encoder {
21 h := hash.New(hash.CryptoType)
22 mw := io.MultiWriter(w, h)
23 return &Encoder{mw, h}
24}
25
26// Encode writes an index into the commit-graph file
27func (e *Encoder) Encode(idx Index) error {

Callers

nothing calls this directly

Calls 1

NewFunction · 0.92

Tested by

no test coverage detected