Return whether git.checkout succeeded

This commit is contained in:
Rachel Macfarlane
2018-09-21 11:47:37 -07:00
parent b4f4f55f5a
commit f50b87442c

View File

@@ -1347,9 +1347,9 @@ export class CommandCenter {
}
@command('git.checkout', { repository: true })
async checkout(repository: Repository, treeish: string): Promise<void> {
async checkout(repository: Repository, treeish: string): Promise<boolean> {
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);
}