MCPcopy Create free account
hub / github.com/backnotprop/plannotator / prepareLocalReviewDiff

Function prepareLocalReviewDiff

packages/shared/vcs-core.ts:418–441  ·  view source on GitHub ↗
(options: PrepareLocalReviewDiffOptions)

Source from the content-addressed store, hash-verified

416 },
417
418 async prepareLocalReviewDiff(options: PrepareLocalReviewDiffOptions): Promise<PreparedLocalReviewDiff> {
419 const { provider, gitContext } = await getContextWithProvider(options.cwd, options.vcsType);
420 const ownsRequestedDiffType = options.requestedDiffType !== undefined
421 && provider.ownsDiffType(options.requestedDiffType);
422 const diffType = resolveRequestedDiffType(
423 provider,
424 gitContext,
425 options.requestedDiffType,
426 options.configuredDiffType,
427 );
428 const base = resolveInitialBase(gitContext, diffType, options.requestedBase, ownsRequestedDiffType);
429 const result = await provider.runDiff(diffType, base, gitContext.cwd ?? options.cwd, {
430 hideWhitespace: options.hideWhitespace,
431 });
432
433 return {
434 gitContext,
435 diffType,
436 base,
437 rawPatch: result.patch,
438 gitRef: result.label,
439 error: result.error,
440 };
441 },
442
443 async runVcsDiff(
444 diffType: DiffType,

Callers 4

handleReviewCommandFunction · 0.90
index.tsFile · 0.90
server.test.tsFile · 0.85

Calls 5

getContextWithProviderFunction · 0.85
resolveRequestedDiffTypeFunction · 0.85
resolveInitialBaseFunction · 0.85
ownsDiffTypeMethod · 0.80
runDiffMethod · 0.80

Tested by

no test coverage detected