MCPcopy Index your code
hub / github.com/changesets/changesets / getDivergedCommit

Function getDivergedCommit

packages/git/src/index.ts:48–56  ·  view source on GitHub ↗
(cwd: string, ref: string)

Source from the content-addressed store, hash-verified

46
47// Find the commit where we diverged from `ref` at using `git merge-base`
48export 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

Callers 3

index.test.tsFile · 0.85
getChangedFilesSinceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected