Skip to content

Commit 69734cf

Browse files
committed
Moves missing remote actions
1 parent 5b63a1c commit 69734cf

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

src/env/node/git/localGitProvider.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,24 +1018,6 @@ export class LocalGitProvider implements GitProvider, Disposable {
10181018
return (await fsExists(uri.fsPath)) ? uri : undefined;
10191019
}
10201020

1021-
@log()
1022-
async addRemote(repoPath: string, name: string, url: string, options?: { fetch?: boolean }): Promise<void> {
1023-
await this.git.remote__add(repoPath, name, url, options);
1024-
this.container.events.fire('git:cache:reset', { repoPath: repoPath, caches: ['remotes'] });
1025-
}
1026-
1027-
@log()
1028-
async pruneRemote(repoPath: string, name: string): Promise<void> {
1029-
await this.git.remote__prune(repoPath, name);
1030-
this.container.events.fire('git:cache:reset', { repoPath: repoPath, caches: ['remotes'] });
1031-
}
1032-
1033-
@log()
1034-
async removeRemote(repoPath: string, name: string): Promise<void> {
1035-
await this.git.remote__remove(repoPath, name);
1036-
this.container.events.fire('git:cache:reset', { repoPath: repoPath, caches: ['remotes'] });
1037-
}
1038-
10391021
@log()
10401022
async applyChangesToWorkingFile(uri: GitUri, ref1?: string, ref2?: string) {
10411023
const scope = getLogScope();

src/env/node/git/sub-providers/remotes.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import type { CancellationToken } from 'vscode';
22
import type { Container } from '../../../../container';
33
import type { GitCache } from '../../../../git/cache';
4+
import type { GitRemotesSubProvider } from '../../../../git/gitProvider';
45
import type { GitRemote } from '../../../../git/models/remote';
56
import { sortRemotes } from '../../../../git/models/remote';
67
import { parseGitRemotes } from '../../../../git/parsers/remoteParser';
78
import { getRemoteProviderMatcher, loadRemoteProviders } from '../../../../git/remotes/remoteProviders';
89
import { RemotesGitProviderBase } from '../../../../git/sub-providers/remotes';
10+
import { gate } from '../../../../system/decorators/gate';
911
import { log } from '../../../../system/decorators/log';
1012
import { Logger } from '../../../../system/logger';
1113
import { getLogScope } from '../../../../system/logger.scope';
1214
import { configuration } from '../../../../system/vscode/configuration';
1315
import type { Git } from '../git';
1416
import type { LocalGitProvider } from '../localGitProvider';
1517

16-
export class RemotesGitSubProvider extends RemotesGitProviderBase {
18+
export class RemotesGitSubProvider extends RemotesGitProviderBase implements GitRemotesSubProvider {
1719
constructor(
1820
container: Container,
1921
private readonly git: Git,
@@ -72,4 +74,25 @@ export class RemotesGitSubProvider extends RemotesGitProviderBase {
7274

7375
return remotes;
7476
}
77+
78+
@gate()
79+
@log()
80+
async addRemote(repoPath: string, name: string, url: string, options?: { fetch?: boolean }): Promise<void> {
81+
await this.git.remote__add(repoPath, name, url, options);
82+
this.container.events.fire('git:cache:reset', { repoPath: repoPath, caches: ['remotes'] });
83+
}
84+
85+
@gate()
86+
@log()
87+
async pruneRemote(repoPath: string, name: string): Promise<void> {
88+
await this.git.remote__prune(repoPath, name);
89+
this.container.events.fire('git:cache:reset', { repoPath: repoPath, caches: ['remotes'] });
90+
}
91+
92+
@gate()
93+
@log()
94+
async removeRemote(repoPath: string, name: string): Promise<void> {
95+
await this.git.remote__remove(repoPath, name);
96+
this.container.events.fire('git:cache:reset', { repoPath: repoPath, caches: ['remotes'] });
97+
}
7598
}

0 commit comments

Comments
 (0)