diff --git a/extensions/git/package.json b/extensions/git/package.json index 805783706c1816817c2145a61a19331deeda618f..e334c0a5251da2c40c68f46f299bdf9b8d03f57c 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 f6c28946620f4542e0c98986dad60ac5a5138d0e..9fd81bfabfe5073c4b81e009f859a983ead66d83 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));