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

Method ForEach

plumbing/object/commit_walker.go:303–323  ·  view source on GitHub ↗
(cb func(*Commit) error)

Source from the content-addressed store, hash-verified

301}
302
303func (it *commitAllIterator) ForEach(cb func(*Commit) error) error {
304 for {
305 c, err := it.Next()
306 if err == io.EOF {
307 break
308 }
309 if err != nil {
310 return err
311 }
312
313 err = cb(c)
314 if err == storer.ErrStop {
315 break
316 }
317 if err != nil {
318 return err
319 }
320 }
321
322 return nil
323}
324
325func (it *commitAllIterator) Close() {
326 it.currCommit = nil

Callers

nothing calls this directly

Calls 1

NextMethod · 0.95

Tested by

no test coverage detected