()
| 382 | } |
| 383 | |
| 384 | export const getChangedFiles = async (): Promise<string[]> => { |
| 385 | const { stdout } = await execFileNoThrow( |
| 386 | gitExe(), |
| 387 | ['--no-optional-locks', 'status', '--porcelain'], |
| 388 | { |
| 389 | preserveOutputOnError: false, |
| 390 | }, |
| 391 | ) |
| 392 | return stdout |
| 393 | .trim() |
| 394 | .split('\n') |
| 395 | .map(line => line.trim().split(' ', 2)[1]?.trim()) // Remove status prefix (e.g., "M ", "A ", "??") |
| 396 | .filter(line => typeof line === 'string') // Remove empty entries |
| 397 | } |
| 398 | |
| 399 | export type GitFileStatus = { |
| 400 | tracked: string[] |
nothing calls this directly
no test coverage detected