issue 163803/ first pick a ref then pick a name in create-branch-from... (#170908)

* pick a ref then a name in create-branch-from...
This commit is contained in:
RezCoder 2023-01-11 17:43:05 +03:30 committed by GitHub
parent c717e011fa
commit 85e992bffa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2189,12 +2189,6 @@ export class CommandCenter {
}
private async _branch(repository: Repository, defaultName?: string, from = false): Promise<void> {
const branchName = await this.promptForBranchName(repository, defaultName);
if (!branchName) {
return;
}
let target = 'HEAD';
if (from) {
@ -2202,7 +2196,7 @@ export class CommandCenter {
return [new HEADItem(repository), ...await createCheckoutItems(repository)];
};
const placeHolder = l10n.t('Select a ref to create the "{0}" branch from', branchName);
const placeHolder = l10n.t('Select a ref to create the branch from');
const choice = await window.showQuickPick(getRefPicks(), { placeHolder });
if (!choice) {
@ -2214,6 +2208,12 @@ export class CommandCenter {
}
}
const branchName = await this.promptForBranchName(repository, defaultName);
if (!branchName) {
return;
}
await repository.branch(branchName, true, target);
}