Returns the old-file starting line number of the hunk containing the given patch line index. Returns 0 if the line is not inside any hunk.
(idx int)
| 54 | // Returns the old-file starting line number of the hunk containing the given |
| 55 | // patch line index. Returns 0 if the line is not inside any hunk. |
| 56 | func (self *Patch) HunkOldStartForLine(idx int) int { |
| 57 | hunkIdx := self.HunkContainingLine(idx) |
| 58 | if hunkIdx == -1 { |
| 59 | return 0 |
| 60 | } |
| 61 | return self.hunks[hunkIdx].oldStart |
| 62 | } |
| 63 | |
| 64 | // Returns the patch line index of the first line in the given hunk |
| 65 | func (self *Patch) HunkStartIdx(hunkIndex int) int { |
no test coverage detected