From fb2f985aa9cd1c9ee74bbac24a2dc467bee7b77a Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 20 Nov 2019 10:12:24 +0100 Subject: [PATCH] git.publish should not ask if only one remote related to #84697 --- extensions/git/src/commands.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 3636d26b491..46e13bd0b8a 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -2162,9 +2162,14 @@ export class CommandCenter { return; } + const branchName = repository.HEAD && repository.HEAD.name || ''; + + if (remotes.length === 1) { + return await repository.pushTo(remotes[0].name, branchName, true); + } + 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 placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName); const choice = await window.showQuickPick(picks, { placeHolder });