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

Method Next

plumbing/object/commit_walker_bfs.go:52–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50}
51
52func (w *bfsCommitIterator) Next() (*Commit, error) {
53 var c *Commit
54 for {
55 if len(w.queue) == 0 {
56 return nil, io.EOF
57 }
58 c = w.queue[0]
59 w.queue = w.queue[1:]
60
61 if w.seen[c.Hash] || w.seenExternal[c.Hash] {
62 continue
63 }
64
65 w.seen[c.Hash] = true
66
67 for _, h := range c.ParentHashes {
68 err := w.appendHash(c.s, h)
69 if err != nil {
70 return nil, err
71 }
72 }
73
74 return c, nil
75 }
76}
77
78func (w *bfsCommitIterator) ForEach(cb func(*Commit) error) error {
79 for {

Callers 1

ForEachMethod · 0.95

Calls 1

appendHashMethod · 0.95

Tested by

no test coverage detected