(changes Changes, parent *Commit)
| 114 | } |
| 115 | |
| 116 | func (c *commitPathIter) hasFileChange(changes Changes, parent *Commit) bool { |
| 117 | for _, change := range changes { |
| 118 | if !c.pathFilter(change.name()) { |
| 119 | continue |
| 120 | } |
| 121 | |
| 122 | // filename matches, now check if source iterator contains all commits (from all refs) |
| 123 | if c.checkParent { |
| 124 | // Check if parent is beyond the initial commit |
| 125 | if parent == nil || isParentHash(parent.Hash, c.currentCommit) { |
| 126 | return true |
| 127 | } |
| 128 | continue |
| 129 | } |
| 130 | |
| 131 | return true |
| 132 | } |
| 133 | |
| 134 | return false |
| 135 | } |
| 136 | |
| 137 | func isParentHash(hash plumbing.Hash, commit *Commit) bool { |
| 138 | for _, h := range commit.ParentHashes { |
no test coverage detected