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

Function NewReader

plumbing/format/objfile/reader.go:31–41  ·  view source on GitHub ↗

NewReader returns a new Reader reading from r.

(r io.Reader)

Source from the content-addressed store, hash-verified

29
30// NewReader returns a new Reader reading from r.
31func NewReader(r io.Reader) (*Reader, error) {
32 zlib, err := sync.GetZlibReader(r)
33 if err != nil {
34 return nil, packfile.ErrZLib.AddDetails("%s", err.Error())
35 }
36
37 return &Reader{
38 zlib: zlib.Reader,
39 zlibref: zlib,
40 }, nil
41}
42
43// Header reads the type and the size of object, and prepares the reader for read
44func (r *Reader) Header() (t plumbing.ObjectType, size int64, err error) {

Callers 9

getFromUnpackedMethod · 0.92
ReaderMethod · 0.92
testReaderFunction · 0.85
TestReadEmptyObjfileMethod · 0.85
TestReadGarbageMethod · 0.85
TestReadCorruptZLibMethod · 0.85

Calls 3

GetZlibReaderFunction · 0.92
AddDetailsMethod · 0.80
ErrorMethod · 0.45

Tested by 6

testReaderFunction · 0.68
TestReadEmptyObjfileMethod · 0.68
TestReadGarbageMethod · 0.68
TestReadCorruptZLibMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…