From 1f0455e028aed7801510aa561f80b64b91e4a36a Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:55:13 +0200 Subject: [PATCH] Git - fix fetchRef, pullRef, pushRef commands --- extensions/git/src/commands.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 686ce366e2939..dc391ce61db3c 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -3051,7 +3051,8 @@ export class CommandCenter { } @command('git.fetchRef', { repository: true }) - async fetchRef(repository: Repository, ref: string): Promise { + async fetchRef(repository: Repository, ref?: string): Promise { + ref = ref ?? repository?.historyProvider.currentHistoryItemGroup?.remote?.id; if (!repository || !ref) { return; } @@ -3123,7 +3124,8 @@ export class CommandCenter { } @command('git.pullRef', { repository: true }) - async pullRef(repository: Repository, ref: string): Promise { + async pullRef(repository: Repository, ref?: string): Promise { + ref = ref ?? repository?.historyProvider.currentHistoryItemGroup?.remote?.id; if (!repository || !ref) { return; } @@ -3270,8 +3272,8 @@ export class CommandCenter { } @command('git.pushRef', { repository: true }) - async pushRef(repository: Repository, ref: string): Promise { - if (!repository || !ref) { + async pushRef(repository: Repository): Promise { + if (!repository) { return; }