(patch: string)
| 309 | } |
| 310 | |
| 311 | export function diffFiles(patch: string): string[] { |
| 312 | const files: string[] = [] |
| 313 | for (const line of patch.split("\n")) { |
| 314 | if (!line.startsWith("diff --git ")) continue |
| 315 | const match = line.match(/^diff --git a\/(.+?) b\/(.+)$/) |
| 316 | if (match?.[2]) files.push(match[2]) |
| 317 | } |
| 318 | return files |
| 319 | } |
| 320 | |
| 321 | export function filterPatch(patch: string, options: { exclude: Set<string> }): string { |
| 322 | if (!patch.trim()) return "" |