Skip to content

Commit 1f793fd

Browse files
Copilotalexr00
andcommitted
Remove command registration and call static method directly
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 81b141c commit 1f793fd

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

src/commands.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -654,19 +654,6 @@ export function registerCommands(
654654
}),
655655
);
656656

657-
context.subscriptions.push(
658-
vscode.commands.registerCommand('pr.openCommitChanges', async (commitSha: string, folderManager?: FolderRepositoryManager) => {
659-
if (!folderManager) {
660-
folderManager = reposManager.folderManagers[0];
661-
}
662-
if (!folderManager) {
663-
vscode.window.showErrorMessage(vscode.l10n.t('No repository found'));
664-
return;
665-
}
666-
return PullRequestModel.openCommitChanges(folderManager, commitSha);
667-
}),
668-
);
669-
670657
let isCheckingOutFromReadonlyFile = false;
671658
context.subscriptions.push(vscode.commands.registerCommand('pr.checkoutFromReadonlyFile', async () => {
672659
const uri = vscode.window.activeTextEditor?.document.uri;

src/github/pullRequestOverview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
530530
private async openCommitChanges(message: IRequestMessage<{ commitSha: string }>): Promise<void> {
531531
try {
532532
const { commitSha } = message.args;
533-
await vscode.commands.executeCommand('pr.openCommitChanges', commitSha, this._folderRepositoryManager);
533+
await PullRequestModel.openCommitChanges(this._folderRepositoryManager, commitSha);
534534
} catch (error) {
535535
Logger.error(`Failed to open commit changes: ${formatError(error)}`, PullRequestOverviewPanel.ID);
536536
vscode.window.showErrorMessage(vscode.l10n.t('Failed to open commit changes: {0}', formatError(error)));

0 commit comments

Comments
 (0)