( lines: string[], context: string[], start: number, eof: boolean, )
| 327 | } |
| 328 | |
| 329 | function findContext( |
| 330 | lines: string[], |
| 331 | context: string[], |
| 332 | start: number, |
| 333 | eof: boolean, |
| 334 | ): { newIndex: number; fuzz: number } { |
| 335 | if (eof) { |
| 336 | const endStart = Math.max(0, lines.length - context.length) |
| 337 | const endMatch = findContextCore(lines, context, endStart) |
| 338 | if (endMatch.newIndex !== -1) { |
| 339 | return endMatch |
| 340 | } |
| 341 | |
| 342 | const fallback = findContextCore(lines, context, start) |
| 343 | return { newIndex: fallback.newIndex, fuzz: fallback.fuzz + 10000 } |
| 344 | } |
| 345 | |
| 346 | return findContextCore(lines, context, start) |
| 347 | } |
| 348 | |
| 349 | function parseUpdateDiff( |
| 350 | lines: string[], |
no test coverage detected