Skip to content

Commit

Permalink
Fixes regressions in gitkraken#2481 fetching remote
Browse files Browse the repository at this point in the history
  • Loading branch information
ShafinKhadem committed Mar 20, 2023
1 parent c965d54 commit 98e9bfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ export const enum CoreGitCommands {
PushForce = 'git.pushForce',
UndoCommit = 'git.undoCommit',
Fetch = 'git.fetch',
FetchAll = 'git.fetchAll',
FetchPrune = 'git.fetchPrune',
}

export const enum CoreGitConfiguration {
Expand Down
11 changes: 9 additions & 2 deletions src/git/models/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,17 @@ export class Repository implements Disposable {
remote?: string;
}) {
try {
if (options?.branch != null) {
if (options?.branch != null || options?.remote) {
await this.container.git.fetch(this.path, options);
} else {
void (await executeCoreGitCommand(CoreGitCommands.Fetch, this.path));
void (await executeCoreGitCommand(
options?.prune
? CoreGitCommands.FetchPrune
: options?.all
? CoreGitCommands.FetchAll
: CoreGitCommands.Fetch,
this.path,
));
}

this.fireChange(RepositoryChange.Unknown);
Expand Down

0 comments on commit 98e9bfa

Please sign in to comment.