(rootDir: string, baseBranch: string)
| 142 | |
| 143 | /** Get files changed on this branch compared to a base branch */ |
| 144 | export function getChangedFiles(rootDir: string, baseBranch: string): string[] { |
| 145 | const ref = getBaseCompareRef(rootDir, baseBranch); |
| 146 | const diff = tryRunArgs(['git', 'diff', '--name-only', ref], { cwd: rootDir }); |
| 147 | if (!diff) return []; |
| 148 | return diff.split('\n').filter(Boolean); |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * Read a file's contents at a given git ref. |
searching dependent graphs…