(rootDir: string, baseBranch: string)
| 133 | * Prefers the merge-base, falls back to `origin/<baseBranch>`. |
| 134 | */ |
| 135 | export function getBaseCompareRef(rootDir: string, baseBranch: string): string { |
| 136 | if (!tryRunArgs(['git', 'rev-parse', '--verify', `origin/${baseBranch}`], { cwd: rootDir })) { |
| 137 | tryRunArgs(['git', 'fetch', 'origin', baseBranch, '--depth=1'], { cwd: rootDir }); |
| 138 | } |
| 139 | const mergeBase = tryRunArgs(['git', 'merge-base', 'HEAD', `origin/${baseBranch}`], { cwd: rootDir }); |
| 140 | return mergeBase || `origin/${baseBranch}`; |
| 141 | } |
| 142 | |
| 143 | /** Get files changed on this branch compared to a base branch */ |
| 144 | export function getChangedFiles(rootDir: string, baseBranch: string): string[] { |
no test coverage detected
searching dependent graphs…