From 855a55d7552dcd732f588ef20ae45aa0334832f3 Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Mon, 2 Oct 2017 11:31:59 +0200 Subject: [PATCH] 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 --- extensions/git/src/commands.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 5ca21612e77..0c10e71bcc4 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -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;