MCPcopy Index your code
hub / github.com/go-git/go-git / ForEach

Method ForEach

plumbing/object/commit_walker_path.go:146–163  ·  view source on GitHub ↗
(cb func(*Commit) error)

Source from the content-addressed store, hash-verified

144}
145
146func (c *commitPathIter) ForEach(cb func(*Commit) error) error {
147 for {
148 commit, nextErr := c.Next()
149 if nextErr == io.EOF {
150 break
151 }
152 if nextErr != nil {
153 return nextErr
154 }
155 err := cb(commit)
156 if err == storer.ErrStop {
157 return nil
158 } else if err != nil {
159 return err
160 }
161 }
162 return nil
163}
164
165func (c *commitPathIter) Close() {
166 c.sourceIter.Close()

Callers

nothing calls this directly

Calls 1

NextMethod · 0.95

Tested by

no test coverage detected