(cwd: string, ref: string)
| 46 | |
| 47 | // Find the commit where we diverged from `ref` at using `git merge-base` |
| 48 | export async function getDivergedCommit(cwd: string, ref: string) { |
| 49 | const cmd = await spawn("git", ["merge-base", ref, "HEAD"], { cwd }); |
| 50 | if (cmd.code !== 0) { |
| 51 | throw new Error( |
| 52 | `Failed to find where HEAD diverged from "${ref}". Does "${ref}" exist and it's synced with remote?` |
| 53 | ); |
| 54 | } |
| 55 | return cmd.stdout.toString().trim(); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Get the SHAs for the commits that added files, including automatically |
no outgoing calls
no test coverage detected