Skip to content

Commit

Permalink
Git - fix fetchRef, pullRef, pushRef commands
Browse files Browse the repository at this point in the history
  • Loading branch information
lszomoru committed Jul 9, 2024
1 parent bfdfd71 commit 1f0455e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions extensions/git/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3051,7 +3051,8 @@ export class CommandCenter {
}

@command('git.fetchRef', { repository: true })
async fetchRef(repository: Repository, ref: string): Promise<void> {
async fetchRef(repository: Repository, ref?: string): Promise<void> {
ref = ref ?? repository?.historyProvider.currentHistoryItemGroup?.remote?.id;
if (!repository || !ref) {
return;
}
Expand Down Expand Up @@ -3123,7 +3124,8 @@ export class CommandCenter {
}

@command('git.pullRef', { repository: true })
async pullRef(repository: Repository, ref: string): Promise<void> {
async pullRef(repository: Repository, ref?: string): Promise<void> {
ref = ref ?? repository?.historyProvider.currentHistoryItemGroup?.remote?.id;
if (!repository || !ref) {
return;
}
Expand Down Expand Up @@ -3270,8 +3272,8 @@ export class CommandCenter {
}

@command('git.pushRef', { repository: true })
async pushRef(repository: Repository, ref: string): Promise<void> {
if (!repository || !ref) {
async pushRef(repository: Repository): Promise<void> {
if (!repository) {
return;
}

Expand Down

0 comments on commit 1f0455e

Please sign in to comment.