()
| 40 | } |
| 41 | |
| 42 | func (c *commitPathIter) Next() (*Commit, error) { |
| 43 | if c.currentCommit == nil { |
| 44 | var err error |
| 45 | c.currentCommit, err = c.sourceIter.Next() |
| 46 | if err != nil { |
| 47 | return nil, err |
| 48 | } |
| 49 | } |
| 50 | commit, commitErr := c.getNextFileCommit() |
| 51 | |
| 52 | // Setting current-commit to nil to prevent unwanted states when errors are raised |
| 53 | if commitErr != nil { |
| 54 | c.currentCommit = nil |
| 55 | } |
| 56 | return commit, commitErr |
| 57 | } |
| 58 | |
| 59 | func (c *commitPathIter) getNextFileCommit() (*Commit, error) { |
| 60 | var parentTree, currentTree *Tree |
no test coverage detected