From 258418fbfbbf9aa366155a70a3178c1a85a13af8 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 3 Jun 2022 00:12:43 -0400 Subject: [PATCH] Fixes invalid config scopes --- src/env/node/git/localGitProvider.ts | 1 - src/git/gitProviderService.ts | 2 +- src/git/models/repository.ts | 6 ++++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 847bf3a..181ce8e 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -343,7 +343,6 @@ export class LocalGitProvider implements GitProvider, Disposable { const autoRepositoryDetection = configuration.getAny( CoreGitConfiguration.AutoRepositoryDetection, - uri, ) ?? true; const folder = workspace.getWorkspaceFolder(uri); diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index 80f561d..6576a3d 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -1831,7 +1831,7 @@ export class GitProviderService implements Disposable { let isDirectory: boolean | undefined; - detectNested = detectNested ?? configuration.get('detectNestedRepositories'); + detectNested = detectNested ?? configuration.get('detectNestedRepositories', uri); if (!detectNested) { if (repository != null) return repository; } else if (this._visitedPaths.has(path)) { diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts index 12c639a..6e8e60d 100644 --- a/src/git/models/repository.ts +++ b/src/git/models/repository.ts @@ -286,7 +286,9 @@ export class Repository implements Disposable { private onConfigurationChanged(e?: ConfigurationChangeEvent) { if (configuration.changed(e, 'remotes', this.folder?.uri)) { - this._providers = RemoteProviderFactory.loadProviders(configuration.get('remotes', this.folder?.uri)); + this._providers = RemoteProviderFactory.loadProviders( + configuration.get('remotes', this.folder?.uri ?? null), + ); if (e != null) { this.resetCaches('remotes'); @@ -573,7 +575,7 @@ export class Repository implements Disposable { async getRemotes(options?: { filter?: (remote: GitRemote) => boolean; sort?: boolean }): Promise { if (this._remotes == null) { if (this._providers == null) { - const remotesCfg = configuration.get('remotes', this.folder?.uri); + const remotesCfg = configuration.get('remotes', this.folder?.uri ?? null); this._providers = RemoteProviderFactory.loadProviders(remotesCfg); }