()
| 815 | * Get staged files from git. |
| 816 | */ |
| 817 | export async function getStagedFiles(): Promise<string[]> { |
| 818 | const cwd = getAttributionRepoRoot() |
| 819 | |
| 820 | try { |
| 821 | const result = await execFileNoThrowWithCwd( |
| 822 | gitExe(), |
| 823 | ['diff', '--cached', '--name-only'], |
| 824 | { cwd, timeout: 5000 }, |
| 825 | ) |
| 826 | |
| 827 | if (result.code === 0 && result.stdout) { |
| 828 | return result.stdout.split('\n').filter(Boolean) |
| 829 | } |
| 830 | } catch (error) { |
| 831 | logError(error as Error) |
| 832 | } |
| 833 | |
| 834 | return [] |
| 835 | } |
| 836 | |
| 837 | // formatAttributionTrailer moved to attributionTrailer.ts for tree-shaking |
| 838 | // (contains excluded strings that should not be in external builds) |
nothing calls this directly
no test coverage detected