提交 c4a1b80e 编写于 作者: J Joao Moreno

fix git settings scope

上级 ad5d3d9f
......@@ -1028,6 +1028,7 @@
},
"git.autofetch": {
"type": "boolean",
"scope": "resource",
"description": "%config.autofetch%",
"default": false,
"tags": [
......
......@@ -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<boolean>('autofetch') === false) {
this.disable();
......@@ -110,7 +110,7 @@ export class AutoFetcher {
return;
}
const period = workspace.getConfiguration('git').get<number>('autofetchPeriod', 180) * 1000;
const period = workspace.getConfiguration('git', Uri.file(this.repository.root)).get<number>('autofetchPeriod', 180) * 1000;
const timeout = new Promise(c => setTimeout(c, period));
const whenDisabled = eventToPromise(filterEvent(this.onDidChange, enabled => !enabled));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册