From c4a1b80e485e90f0a496001c9c20ab1999a7bf1f Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 7 Jan 2019 09:58:34 +0100 Subject: [PATCH] fix git settings scope --- extensions/git/package.json | 1 + extensions/git/src/autofetch.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index 805783706c1..e334c0a5251 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1028,6 +1028,7 @@ }, "git.autofetch": { "type": "boolean", + "scope": "resource", "description": "%config.autofetch%", "default": false, "tags": [ diff --git a/extensions/git/src/autofetch.ts b/extensions/git/src/autofetch.ts index f6c28946620..9fd81bfabfe 100644 --- a/extensions/git/src/autofetch.ts +++ b/extensions/git/src/autofetch.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { workspace, Disposable, EventEmitter, Memento, window, MessageItem, ConfigurationTarget } from 'vscode'; +import { workspace, Disposable, EventEmitter, Memento, window, MessageItem, ConfigurationTarget, Uri } from 'vscode'; import { Repository, Operation } from './repository'; import { eventToPromise, filterEvent, onceEvent } from './util'; import * as nls from 'vscode-nls'; @@ -60,7 +60,7 @@ export class AutoFetcher { } if (result === yes) { - const gitConfig = workspace.getConfiguration('git'); + const gitConfig = workspace.getConfiguration('git', Uri.file(this.repository.root)); gitConfig.update('autofetch', true, ConfigurationTarget.Global); } @@ -68,7 +68,7 @@ export class AutoFetcher { } private onConfiguration(): void { - const gitConfig = workspace.getConfiguration('git'); + const gitConfig = workspace.getConfiguration('git', Uri.file(this.repository.root)); if (gitConfig.get('autofetch') === false) { this.disable(); @@ -110,7 +110,7 @@ export class AutoFetcher { return; } - const period = workspace.getConfiguration('git').get('autofetchPeriod', 180) * 1000; + const period = workspace.getConfiguration('git', Uri.file(this.repository.root)).get('autofetchPeriod', 180) * 1000; const timeout = new Promise(c => setTimeout(c, period)); const whenDisabled = eventToPromise(filterEvent(this.onDidChange, enabled => !enabled)); -- GitLab