(oldContent: string, diff: string)
| 480 | } |
| 481 | |
| 482 | function buildPatchAttempts(oldContent: string, diff: string): PatchAttempt[] { |
| 483 | const normalizedOld = normalizeLineEndings(oldContent) |
| 484 | const normalizedDiff = normalizeLineEndings(diff) |
| 485 | |
| 486 | return [ |
| 487 | { name: 'codex_like', source: normalizedOld, diff: normalizedDiff }, |
| 488 | { |
| 489 | name: 'with_trailing_newline', |
| 490 | source: ensureTrailingNewline(normalizedOld), |
| 491 | diff: normalizedDiff, |
| 492 | }, |
| 493 | { |
| 494 | name: 'without_trailing_newline', |
| 495 | source: stripTrailingNewline(normalizedOld), |
| 496 | diff: normalizedDiff, |
| 497 | }, |
| 498 | ] |
| 499 | } |
| 500 | |
| 501 | function tryApplyPatchWithFallbacks(params: { |
| 502 | oldContent: string |
no test coverage detected