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)
| 23 | // Deprecated: This package uses the wrong types for Generation and Index in CommitData. |
| 24 | // Use the v2 package instead. |
| 25 | func 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 | // |