mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
💄
This commit is contained in:
parent
1852e0c764
commit
2125bcf9af
|
@ -53,7 +53,7 @@
|
|||
"command.removeRemote": "Remove Remote",
|
||||
"command.sync": "Sync",
|
||||
"command.syncRebase": "Sync (Rebase)",
|
||||
"command.publish": "Publish Branch",
|
||||
"command.publish": "Publish Branch...",
|
||||
"command.showOutput": "Show Git Output",
|
||||
"command.ignore": "Add to .gitignore",
|
||||
"command.revealInExplorer": "Reveal in Explorer",
|
||||
|
|
|
@ -1747,7 +1747,7 @@ export class CommandCenter {
|
|||
|
||||
const remoteRefs = repository.refs;
|
||||
const remoteRefsFiltered = remoteRefs.filter(r => (r.remote === remotePick.label));
|
||||
const branchPicks = remoteRefsFiltered.map(r => ({ label: r.name })) as { label: string; description: string }[];
|
||||
const branchPicks = remoteRefsFiltered.map(r => ({ label: r.name! }));
|
||||
const branchPlaceHolder = localize('pick branch pull', "Pick a branch to pull from");
|
||||
const branchPick = await window.showQuickPick(branchPicks, { placeHolder: branchPlaceHolder });
|
||||
|
||||
|
@ -1854,15 +1854,24 @@ export class CommandCenter {
|
|||
}
|
||||
} else {
|
||||
const branchName = repository.HEAD.name;
|
||||
const picks = remotes.filter(r => r.pushUrl !== undefined).map(r => ({ label: r.name, description: r.pushUrl! }));
|
||||
const addRemote = new AddRemoteItem(this);
|
||||
const picks = [...remotes.filter(r => r.pushUrl !== undefined).map(r => ({ label: r.name, description: r.pushUrl })), addRemote];
|
||||
const placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName);
|
||||
const pick = await window.showQuickPick(picks, { placeHolder });
|
||||
const choice = await window.showQuickPick(picks, { placeHolder });
|
||||
|
||||
if (!pick) {
|
||||
if (!choice) {
|
||||
return;
|
||||
}
|
||||
|
||||
await repository.pushTo(pick.label, branchName, undefined, forcePushMode);
|
||||
if (choice === addRemote) {
|
||||
const newRemote = await this.addRemote(repository);
|
||||
|
||||
if (newRemote) {
|
||||
await repository.pushTo(newRemote, branchName, undefined, forcePushMode);
|
||||
}
|
||||
} else {
|
||||
await repository.pushTo(choice.label, branchName, undefined, forcePushMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2057,10 +2066,8 @@ export class CommandCenter {
|
|||
}
|
||||
|
||||
const addRemote = new AddRemoteItem(this);
|
||||
|
||||
const picks = [...repository.remotes.map(r => ({ label: r.name, description: r.pushUrl })), addRemote];
|
||||
const branchName = repository.HEAD && repository.HEAD.name || '';
|
||||
|
||||
const picks = [...repository.remotes.map(r => ({ label: r.name, description: '' })), addRemote];
|
||||
const placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName);
|
||||
const choice = await window.showQuickPick(picks, { placeHolder });
|
||||
|
||||
|
@ -2068,21 +2075,17 @@ export class CommandCenter {
|
|||
return;
|
||||
}
|
||||
|
||||
let remote = choice.label;
|
||||
|
||||
if (choice === addRemote) {
|
||||
const newRemote = await this.addRemote(repository);
|
||||
|
||||
if (newRemote) {
|
||||
remote = newRemote;
|
||||
await repository.pushTo(newRemote, branchName, true);
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
await repository.pushTo(choice.label, branchName, true);
|
||||
}
|
||||
}
|
||||
|
||||
await repository.pushTo(remote, branchName, true);
|
||||
}
|
||||
|
||||
@command('git.ignore')
|
||||
async ignore(...resourceStates: SourceControlResourceState[]): Promise<void> {
|
||||
resourceStates = resourceStates.filter(s => !!s);
|
||||
|
|
Loading…
Reference in a new issue