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

Function newPackfileIter

storage/filesystem/object.go:744–772  ·  view source on GitHub ↗
(
	fs billy.Filesystem,
	f billy.File,
	t plumbing.ObjectType,
	seen map[plumbing.Hash]struct{},
	index idxfile.Index,
	cache cache.Object,
	keepPack bool,
	largeObjectThreshold int64,
)

Source from the content-addressed store, hash-verified

742}
743
744func newPackfileIter(
745 fs billy.Filesystem,
746 f billy.File,
747 t plumbing.ObjectType,
748 seen map[plumbing.Hash]struct{},
749 index idxfile.Index,
750 cache cache.Object,
751 keepPack bool,
752 largeObjectThreshold int64,
753) (storer.EncodedObjectIter, error) {
754 var p *packfile.Packfile
755 if cache != nil {
756 p = packfile.NewPackfileWithCache(index, fs, f, cache, largeObjectThreshold)
757 } else {
758 p = packfile.NewPackfile(index, fs, f, largeObjectThreshold)
759 }
760
761 iter, err := p.GetByType(t)
762 if err != nil {
763 return nil, err
764 }
765
766 return &packfileIter{
767 pack: f,
768 iter: iter,
769 seen: seen,
770 keepPack: keepPack,
771 }, nil
772}
773
774func (iter *packfileIter) Next() (plumbing.EncodedObject, error) {
775 for {

Callers 2

buildPackfileItersMethod · 0.85
NewPackfileIterFunction · 0.85

Calls 3

GetByTypeMethod · 0.95
NewPackfileWithCacheFunction · 0.92
NewPackfileFunction · 0.92

Tested by

no test coverage detected