From dd5c3a996d8f8ec82470321c4093911668b3035e Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 20 Oct 2022 14:59:38 -0400 Subject: [PATCH] Fixes #2281 hasRemote context when integrations are off --- CHANGELOG.md | 1 + src/git/gitProviderService.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0475f56..e43c226 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Fixed +- Fixes [#2281](https://github.com/gitkraken/vscode-gitlens/issues/2281) - Push and Pull buttons missing from the commits view w/ integrations disabled - Fixes [#2276](https://github.com/gitkraken/vscode-gitlens/issues/2276) - Search commit by Sha not working in Gitlens side bar ## [13.0.3] - 2022-10-20 diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index 7ad4114..b5af692 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -760,12 +760,14 @@ export class GitProviderService implements Disposable { // Don't block for the remote context updates (because it can block other downstream requests during initialization) async function updateRemoteContext(this: GitProviderService) { + const integrations = configuration.get('integrations.enabled'); + let hasRemotes = false; let hasRichRemotes = false; let hasConnectedRemotes = false; - if (hasRepositories && configuration.get('integrations.enabled')) { + if (hasRepositories) { for (const repo of this._repositories.values()) { - if (!hasConnectedRemotes) { + if (!hasConnectedRemotes && integrations) { hasConnectedRemotes = await repo.hasRichRemote(true); if (hasConnectedRemotes) { @@ -774,7 +776,7 @@ export class GitProviderService implements Disposable { } } - if (!hasRichRemotes) { + if (!hasRichRemotes && integrations) { hasRichRemotes = await repo.hasRichRemote(); if (hasRichRemotes) { @@ -786,7 +788,7 @@ export class GitProviderService implements Disposable { hasRemotes = await repo.hasRemotes(); } - if (hasRemotes && hasRichRemotes && hasConnectedRemotes) break; + if (hasRemotes && ((hasRichRemotes && hasConnectedRemotes) || !integrations)) break; } }