fix: use single remote automatically

If there is only one remote configured just use it instead of aksing the user which remote to use.

Closes #35373
This commit is contained in:
Markus Wolf
2017-10-02 11:31:59 +02:00
parent bac2a9b0a5
commit 855a55d755

View File

@@ -1230,9 +1230,12 @@ export class CommandCenter {
}
const branchName = repository.HEAD && repository.HEAD.name || '';
const picks = repository.remotes.map(r => r.name);
const placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName);
const choice = await window.showQuickPick(picks, { placeHolder });
const selectRemote = async () => {
const picks = repository.remotes.map(r => r.name);
const placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName);
return await window.showQuickPick(picks, { placeHolder });
};
const choice = remotes.length === 1 ? remotes[0].name : await selectRemote();
if (!choice) {
return;