From 1596c6ab83ebe37a8a7a6c3294cf19876a4e2ffe Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 14 Dec 2020 23:07:49 -0500 Subject: [PATCH] Fixes push to commit showing repo picker Clarifies that commit will be included in push --- CHANGELOG.md | 1 + src/commands/git/push.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3f7d0f..7806c22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Fixes an issue where _GitLens: Show Repositories View_ command wouldn't work unless the view was enabled first - Fixes an issue where _GitLens: Show Line History View_ command wasn't showing up unless the view was enabled first - Fixes an issue where trying to force push the current branch would fail +- Fixes an issue where _Push to Commit..._ would incorrectly show a repository picker ## [11.0.6] - 2020-11.28 diff --git a/src/commands/git/push.ts b/src/commands/git/push.ts index e4b9a0f..4546780 100644 --- a/src/commands/git/push.ts +++ b/src/commands/git/push.ts @@ -109,7 +109,10 @@ export class PushGitCommand extends QuickCommand { state.repos = [context.repos[0]]; } else if (state.reference != null) { - const result = yield* pickRepositoryStep(state, context); + const result = yield* pickRepositoryStep( + { ...state, repos: undefined, repo: state.reference.repoPath }, + context, + ); // Always break on the first step (so we will go back) if (result === StepResult.Break) break; @@ -347,7 +350,9 @@ export class PushGitCommand extends QuickCommand { if (state.reference != null) { pushDetails = `${ status?.state.ahead - ? ` commits up to ${GitReference.toString(state.reference, { label: false })}` + ? ` commits up to and including ${GitReference.toString(state.reference, { + label: false, + })}` : '' }${status?.upstream ? ` to ${GitBranch.getRemote(status.upstream)}` : ''}`; } else {