Skip to content

Commit

Permalink
Fix SCM accept input commnad
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Vinokur <[email protected]>
  • Loading branch information
vinokurig committed Oct 8, 2020
1 parent eb1136b commit 19757c8
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions packages/scm/src/browser/scm-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import { ScmService } from './scm-service';
import { ScmWidget } from '../browser/scm-widget';
import URI from '@theia/core/lib/common/uri';
import { ScmQuickOpenService } from './scm-quick-open-service';
import { ScmRepository } from './scm-repository';
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
import { ColorRegistry, Color } from '@theia/core/lib/browser/color-registry';
import { ScmCommand } from './scm-provider';

export const SCM_WIDGET_FACTORY_ID = ScmWidget.ID;
export const SCM_VIEW_CONTAINER_ID = 'scm-view-container';
Expand Down Expand Up @@ -222,26 +222,16 @@ export class ScmContribution extends AbstractViewContribution<ScmWidget> impleme

protected async acceptInput(): Promise<void> {
const command = this.acceptInputCommand();
if (command) {
await this.commands.executeCommand(command.command, command.repository);
if (command && command.command) {
await this.commands.executeCommand(command.command, ...command.arguments);
}
}
protected acceptInputCommand(): {
command: string
repository: ScmRepository
} | undefined {
protected acceptInputCommand(): ScmCommand | undefined {
const repository = this.scmService.selectedRepository;
if (!repository) {
return undefined;
}
const command = repository.provider.acceptInputCommand;
if (!command || !command.command) {
return undefined;
}
return {
command: command.command,
repository
};
return repository.provider.acceptInputCommand;
}

protected readonly statusBarDisposable = new DisposableCollection();
Expand Down

0 comments on commit 19757c8

Please sign in to comment.