(cb func(*Commit) error)
| 144 | } |
| 145 | |
| 146 | func (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 | |
| 165 | func (c *commitPathIter) Close() { |
| 166 | c.sourceIter.Close() |