提交 906c12a2 编写于 作者: J Joao Moreno

add git.autorefresh setting

fixes #901
上级 faeb58eb
...@@ -404,7 +404,7 @@ export class GitService extends ee.EventEmitter ...@@ -404,7 +404,7 @@ export class GitService extends ee.EventEmitter
private reactiveStatusDelayer: async.PeriodThrottledDelayer<void>; private reactiveStatusDelayer: async.PeriodThrottledDelayer<void>;
private autoFetcher: AutoFetcher; private autoFetcher: AutoFetcher;
private isStatusPending = false; private isStatusPending = false;
private isFocused = false; private isFocused = true;
private _allowHugeRepositories: boolean; private _allowHugeRepositories: boolean;
get allowHugeRepositories(): boolean { return this._allowHugeRepositories; } get allowHugeRepositories(): boolean { return this._allowHugeRepositories; }
...@@ -613,6 +613,12 @@ export class GitService extends ee.EventEmitter ...@@ -613,6 +613,12 @@ export class GitService extends ee.EventEmitter
this.isStatusPending = false; this.isStatusPending = false;
const config = this.configurationService.getConfiguration<git.IGitConfiguration>('git');
if (!config.autorefresh) {
return;
}
this.reactiveStatusDelayer.trigger(() => this.status()).done(null, e => { this.reactiveStatusDelayer.trigger(() => this.status()).done(null, e => {
if (errors.isPromiseCanceledError(e)) { if (errors.isPromiseCanceledError(e)) {
return; return;
......
...@@ -523,6 +523,11 @@ export function registerContributions(): void { ...@@ -523,6 +523,11 @@ export function registerContributions(): void {
description: nls.localize('gitPath', "Path to the git executable"), description: nls.localize('gitPath', "Path to the git executable"),
default: null default: null
}, },
'git.autorefresh': {
type: 'boolean',
description: nls.localize('gitAutoRefresh', "Whether auto refreshing is enabled"),
default: true
},
'git.autofetch': { 'git.autofetch': {
type: 'boolean', type: 'boolean',
description: nls.localize('gitAutoFetch', "Whether auto fetching is enabled."), description: nls.localize('gitAutoFetch', "Whether auto fetching is enabled."),
......
...@@ -230,6 +230,7 @@ export var ServiceOperations = { ...@@ -230,6 +230,7 @@ export var ServiceOperations = {
export interface IGitConfiguration { export interface IGitConfiguration {
enabled: boolean; enabled: boolean;
path: string; path: string;
autorefresh: boolean;
autofetch: boolean; autofetch: boolean;
enableLongCommitWarning: boolean; enableLongCommitWarning: boolean;
allowLargeRepositories: boolean; allowLargeRepositories: boolean;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册