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

Method ForEach

plumbing/object/commit_walker_limit.go:44–61  ·  view source on GitHub ↗
(cb func(*Commit) error)

Source from the content-addressed store, hash-verified

42}
43
44func (c *commitLimitIter) ForEach(cb func(*Commit) error) error {
45 for {
46 commit, nextErr := c.Next()
47 if nextErr == io.EOF {
48 break
49 }
50 if nextErr != nil {
51 return nextErr
52 }
53 err := cb(commit)
54 if err == storer.ErrStop {
55 return nil
56 } else if err != nil {
57 return err
58 }
59 }
60 return nil
61}
62
63func (c *commitLimitIter) Close() {
64 c.sourceIter.Close()

Callers

nothing calls this directly

Calls 1

NextMethod · 0.95

Tested by

no test coverage detected