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

Method prepareForWrite

plumbing/format/objfile/writer.go:64–69  ·  view source on GitHub ↗
(t plumbing.ObjectType, size int64)

Source from the content-addressed store, hash-verified

62}
63
64func (w *Writer) prepareForWrite(t plumbing.ObjectType, size int64) {
65 w.pending = size
66
67 w.hasher = plumbing.NewHasher(t, size)
68 w.multi = io.MultiWriter(w.zlib, w.hasher)
69}
70
71// Write writes the object's contents. Write returns the error ErrOverflow if
72// more than size bytes are written after WriteHeader.

Callers 1

WriteHeaderMethod · 0.95

Calls 1

NewHasherFunction · 0.92

Tested by

no test coverage detected