(options: PrepareLocalReviewDiffOptions)
| 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, |
no test coverage detected