mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
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:
parent
c717e011fa
commit
85e992bffa
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue