(patch: string | null)
| 318 | // --------------------------------------------------------------------------- |
| 319 | |
| 320 | export function extractChangedFiles(patch: string | null): string[] { |
| 321 | if (!patch) return []; |
| 322 | const set = new Set<string>(); |
| 323 | const re = /^diff --git a\/(.+?) b\/(.+)$/gm; |
| 324 | let m: RegExpExecArray | null; |
| 325 | while ((m = re.exec(patch)) !== null) { |
| 326 | set.add(m[1]); |
| 327 | set.add(m[2]); |
| 328 | } |
| 329 | return [...set]; |
| 330 | } |
| 331 | |
| 332 | // --------------------------------------------------------------------------- |
| 333 | // Validation |
no test coverage detected