Skip to content

Commit 4719e6e

Browse files
committed
Adds a way to tell if a respository is virtual
1 parent 6fab75c commit 4719e6e

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

src/env/node/git/localGitProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ interface RepositoryInfo {
144144
}
145145

146146
export class LocalGitProvider implements GitProvider, Disposable {
147-
readonly descriptor: GitProviderDescriptor = { id: GitProviderId.Git, name: 'Git' };
147+
readonly descriptor: GitProviderDescriptor = { id: GitProviderId.Git, name: 'Git', virtual: false };
148148
readonly supportedSchemes: Set<string> = new Set([
149149
Schemes.File,
150150
Schemes.Git,

src/env/node/git/vslsGitProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export class VslsGit extends Git {
3434
}
3535

3636
export class VslsGitProvider extends LocalGitProvider {
37-
override readonly descriptor: GitProviderDescriptor = { id: GitProviderId.Vsls, name: 'Live Share' };
37+
override readonly descriptor: GitProviderDescriptor = {
38+
id: GitProviderId.Vsls,
39+
name: 'Live Share',
40+
virtual: false,
41+
};
3842
override readonly supportedSchemes: Set<string> = new Set([Schemes.Vsls, Schemes.VslsScc]);
3943

4044
override async discoverRepositories(uri: Uri): Promise<Repository[]> {

src/git/gitProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const enum GitProviderId {
3535
export interface GitProviderDescriptor {
3636
readonly id: GitProviderId;
3737
readonly name: string;
38+
readonly virtual: boolean;
3839
}
3940

4041
export interface RepositoryInitWatcher extends Disposable {

src/git/models/repository.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ export class Repository implements Disposable {
265265
this._disposable.dispose();
266266
}
267267

268+
get virtual(): boolean {
269+
return this.provider.virtual;
270+
}
271+
268272
get path(): string {
269273
return this.uri.scheme === Schemes.File ? normalizePath(this.uri.fsPath) : this.uri.toString();
270274
}

src/plus/github/githubGitProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ interface RepositoryInfo {
8383
}
8484

8585
export class GitHubGitProvider implements GitProvider, Disposable {
86-
descriptor = { id: GitProviderId.GitHub, name: 'GitHub' };
86+
descriptor = { id: GitProviderId.GitHub, name: 'GitHub', virtual: true };
8787
readonly supportedSchemes: Set<string> = new Set([Schemes.Virtual, Schemes.GitHub, Schemes.PRs]);
8888

8989
private _onDidChangeRepository = new EventEmitter<RepositoryChangeEvent>();

0 commit comments

Comments
 (0)