in packages/vscode-extension-web-ide/src/commands/checkoutBranch.ts [205:226]
export default (asyncOptions: Thenable<CommandsInitialData>, sourceControl: SourceControlSystem) =>
async () => {
const options = await asyncOptions;
const defaultItems = options.userPermissions.pushCode ? [ITEM_CREATE_NEW] : [];
const selection = await showSearchableQuickPick<BranchQuickPickItem>({
placeholder: MSG_SELECT_BRANCH,
defaultItems,
searchItems: searchPattern => searchBranches(searchPattern, defaultItems, options),
handleSearchError,
});
const ref = await getRefFromBranchSelection(selection, options);
// what: User canceled something
if (!ref) {
return;
}
await loadRef(ref, sourceControl);
};