Returns hunk index containing the line at the given patch line index
(idx int)
| 116 | |
| 117 | // Returns hunk index containing the line at the given patch line index |
| 118 | func (self *Patch) HunkContainingLine(idx int) int { |
| 119 | for hunkIdx, hunk := range self.hunks { |
| 120 | hunkStartIdx := self.HunkStartIdx(hunkIdx) |
| 121 | if idx >= hunkStartIdx && idx < hunkStartIdx+hunk.lineCount() { |
| 122 | return hunkIdx |
| 123 | } |
| 124 | } |
| 125 | return -1 |
| 126 | } |
| 127 | |
| 128 | // Returns the patch line index of the next change (i.e. addition or deletion) |
| 129 | // that matches the same "included" state, given the includedLines. If you don't |
no test coverage detected