diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index e72f0986ef2..ac0b676894a 100755 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -1347,9 +1347,9 @@ export class CommandCenter { } @command('git.checkout', { repository: true }) - async checkout(repository: Repository, treeish: string): Promise { + async checkout(repository: Repository, treeish: string): Promise { if (typeof treeish === 'string') { - return await repository.checkout(treeish); + return await repository.checkout(treeish).then(_ => true); } const config = workspace.getConfiguration('git'); @@ -1373,10 +1373,10 @@ export class CommandCenter { const choice = await window.showQuickPick(picks, { placeHolder }); if (!choice) { - throw new Error('Cancelled'); + return false; } - await choice.run(repository); + return choice.run(repository).then(_ => true); }