Browse Source

Adds a way to tell if a respository is virtual

main
Eric Amodio 2 years ago
parent
commit
4719e6e6ce
5 changed files with 12 additions and 3 deletions
  1. +1
    -1
      src/env/node/git/localGitProvider.ts
  2. +5
    -1
      src/env/node/git/vslsGitProvider.ts
  3. +1
    -0
      src/git/gitProvider.ts
  4. +4
    -0
      src/git/models/repository.ts
  5. +1
    -1
      src/plus/github/githubGitProvider.ts

+ 1
- 1
src/env/node/git/localGitProvider.ts View File

@ -144,7 +144,7 @@ interface RepositoryInfo {
}
export class LocalGitProvider implements GitProvider, Disposable {
readonly descriptor: GitProviderDescriptor = { id: GitProviderId.Git, name: 'Git' };
readonly descriptor: GitProviderDescriptor = { id: GitProviderId.Git, name: 'Git', virtual: false };
readonly supportedSchemes: Set<string> = new Set([
Schemes.File,
Schemes.Git,

+ 5
- 1
src/env/node/git/vslsGitProvider.ts View File

@ -34,7 +34,11 @@ export class VslsGit extends Git {
}
export class VslsGitProvider extends LocalGitProvider {
override readonly descriptor: GitProviderDescriptor = { id: GitProviderId.Vsls, name: 'Live Share' };
override readonly descriptor: GitProviderDescriptor = {
id: GitProviderId.Vsls,
name: 'Live Share',
virtual: false,
};
override readonly supportedSchemes: Set<string> = new Set([Schemes.Vsls, Schemes.VslsScc]);
override async discoverRepositories(uri: Uri): Promise<Repository[]> {

+ 1
- 0
src/git/gitProvider.ts View File

@ -35,6 +35,7 @@ export const enum GitProviderId {
export interface GitProviderDescriptor {
readonly id: GitProviderId;
readonly name: string;
readonly virtual: boolean;
}
export interface RepositoryInitWatcher extends Disposable {

+ 4
- 0
src/git/models/repository.ts View File

@ -265,6 +265,10 @@ export class Repository implements Disposable {
this._disposable.dispose();
}
get virtual(): boolean {
return this.provider.virtual;
}
get path(): string {
return this.uri.scheme === Schemes.File ? normalizePath(this.uri.fsPath) : this.uri.toString();
}

+ 1
- 1
src/plus/github/githubGitProvider.ts View File

@ -83,7 +83,7 @@ interface RepositoryInfo {
}
export class GitHubGitProvider implements GitProvider, Disposable {
descriptor = { id: GitProviderId.GitHub, name: 'GitHub' };
descriptor = { id: GitProviderId.GitHub, name: 'GitHub', virtual: true };
readonly supportedSchemes: Set<string> = new Set([Schemes.Virtual, Schemes.GitHub, Schemes.PRs]);
private _onDidChangeRepository = new EventEmitter<RepositoryChangeEvent>();

Loading…
Cancel
Save