From 48738a1b83912ab99aff570fbc1a7fbc8cc361b7 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 30 Nov 2020 01:15:37 -0500 Subject: [PATCH] Fixes push confirm message when not ahead --- src/commands/git/push.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/commands/git/push.ts b/src/commands/git/push.ts index 8e74d15..8dab5a3 100644 --- a/src/commands/git/push.ts +++ b/src/commands/git/push.ts @@ -302,7 +302,7 @@ export class PushGitCommand extends QuickCommand { undefined, { placeholder: 'Confirm Publish' }, ); - } else { + } else if (status.upstream == null) { step = this.createConfirmStep( appendReposToTitle('Confirm Publish', state, context), [], @@ -312,6 +312,15 @@ export class PushGitCommand extends QuickCommand { }), { placeholder: 'Confirm Publish' }, ); + } else { + step = this.createConfirmStep( + appendReposToTitle('Confirm Push', state, context), + [], + DirectiveQuickPickItem.create(Directive.Cancel, true, { + label: `Cancel ${this.title}`, + detail: `Cannot push; No commits ahead of ${GitBranch.getRemote(status.upstream)}`, + }), + ); } } else { let lastFetchedOn = '';