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

Method Next

plumbing/object/commit_walker.go:141–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139}
140
141func (w *commitPostIterator) Next() (*Commit, error) {
142 for {
143 if len(w.stack) == 0 {
144 return nil, io.EOF
145 }
146
147 c := w.stack[len(w.stack)-1]
148 w.stack = w.stack[:len(w.stack)-1]
149
150 if w.seen[c.Hash] {
151 continue
152 }
153
154 w.seen[c.Hash] = true
155
156 return c, c.Parents().ForEach(func(p *Commit) error {
157 w.stack = append(w.stack, p)
158 return nil
159 })
160 }
161}
162
163func (w *commitPostIterator) ForEach(cb func(*Commit) error) error {
164 for {

Callers 1

ForEachMethod · 0.95

Calls 2

ParentsMethod · 0.80
ForEachMethod · 0.65

Tested by

no test coverage detected