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

add git.autorefresh setting

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