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

Method Next

storage/filesystem/object.go:669–696  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

667}
668
669func (it *lazyPackfilesIter) Next() (plumbing.EncodedObject, error) {
670 for {
671 if it.cur == nil {
672 if len(it.hashes) == 0 {
673 return nil, io.EOF
674 }
675 h := it.hashes[0]
676 it.hashes = it.hashes[1:]
677
678 sub, err := it.open(h)
679 if err == io.EOF {
680 continue
681 } else if err != nil {
682 return nil, err
683 }
684 it.cur = sub
685 }
686 ob, err := it.cur.Next()
687 if err == io.EOF {
688 it.cur.Close()
689 it.cur = nil
690 continue
691 } else if err != nil {
692 return nil, err
693 }
694 return ob, nil
695 }
696}
697
698func (it *lazyPackfilesIter) ForEach(cb func(plumbing.EncodedObject) error) error {
699 return storer.ForEachIterator(it, cb)

Callers

nothing calls this directly

Calls 2

NextMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected