MCPcopy Create free account
hub / github.com/ReviewStage/stage-cli / resolveDiffScope

Function resolveDiffScope

packages/cli/src/scope.ts:30–37  ·  view source on GitHub ↗
(options: DiffScopeOptions)

Source from the content-addressed store, hash-verified

28 * scope comes from the local-ref heuristics in {@link resolveScope}.
29 */
30export async function resolveDiffScope(options: DiffScopeOptions): Promise<ResolvedDiffScope> {
31 if (options.pr !== undefined) {
32 const { root, originUrl } = readRepoContext();
33 const { number, baseSha, headSha } = await resolvePullRequestRefs(root, originUrl, options.pr);
34 return { ...resolveCommittedComparison(baseSha, headSha), prNumber: number };
35 }
36 return { ...resolveScope(options), prNumber: null };
37}
38
39/**
40 * Resolve just the PR number from a `--pr` reference, without fetching the PR's

Callers 2

runPrepFunction · 0.85
buildChaptersFileFunction · 0.85

Calls 4

readRepoContextFunction · 0.85
resolvePullRequestRefsFunction · 0.85
resolveScopeFunction · 0.85

Tested by

no test coverage detected