| 83 | } |
| 84 | |
| 85 | function getDiffPath(text: string): string | null { |
| 86 | for (const line of text.split(/\r?\n/)) { |
| 87 | const match = line.match(/^\+\+\+\s+(?:b\/)?(.+)$/); |
| 88 | if (match?.[1] && match[1] !== "/dev/null") { |
| 89 | return match[1].trim(); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | for (const line of text.split(/\r?\n/)) { |
| 94 | const match = line.match(/^---\s+(?:a\/)?(.+)$/); |
| 95 | if (match?.[1] && match[1] !== "/dev/null") { |
| 96 | return match[1].trim(); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | return null; |
| 101 | } |
| 102 | |
| 103 | function getDiffLines(text: string): FileEditDiffLine[] { |
| 104 | const rawLines = text.split(/\r?\n/); |