From f50b87442c87f4d53b66e50c8f1283ff385b72fe Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Fri, 21 Sep 2018 11:47:37 -0700 Subject: [PATCH] Return whether git.checkout succeeded --- extensions/git/src/commands.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); }