(line: string, lineIdx: number)
| 236 | * Hunk header is a group of three lines started by ( `--- ` , `+++ ` , `@@` ) |
| 237 | */ |
| 238 | function existHunkHeader(line: string, lineIdx: number): boolean { |
| 239 | let idx = lineIdx; |
| 240 | |
| 241 | while (idx < diffLines.length - 3) { |
| 242 | if (line.startsWith('diff')) { |
| 243 | return false; |
| 244 | } |
| 245 | |
| 246 | if ( |
| 247 | diffLines[idx].startsWith(oldFileNameHeader) && |
| 248 | diffLines[idx + 1].startsWith(newFileNameHeader) && |
| 249 | diffLines[idx + 2].startsWith(hunkHeaderPrefix) |
| 250 | ) { |
| 251 | return true; |
| 252 | } |
| 253 | |
| 254 | idx++; |
| 255 | } |
| 256 | |
| 257 | return false; |
| 258 | } |
| 259 | |
| 260 | diffLines.forEach((line, lineIndex) => { |
| 261 | // Unmerged paths, and possibly other non-diffable files |
no outgoing calls
no test coverage detected
searching dependent graphs…