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

Merge commit 'refs/pull/55976/head' of github.com:Microsoft/vscode into pr/55976

......@@ -1034,6 +1034,12 @@
"default": 10,
"description": "%config.detectSubmodulesLimit%"
},
"git.showStagedChangesResourceGroup": {
"type": "boolean",
"scope": "resource",
"default": false,
"description": "%config.showStagedChangesResourceGroup%"
},
"git.alwaysSignOff": {
"type": "boolean",
"scope": "resource",
......
......@@ -85,6 +85,7 @@
"config.detectSubmodules": "Controls whether to automatically detect git submodules.",
"colors.added": "Color for added resources.",
"config.detectSubmodulesLimit": "Controls the limit of git submodules detected.",
"config.showStagedChangesResourceGroup": "Always show the Staged Changes resource group.",
"config.alwaysSignOff": "Controls the signoff flag for all commits.",
"config.ignoredRepositories": "List of git repositories to ignore.",
"config.showProgress": "Controls whether git actions should show progress.",
......
......@@ -600,8 +600,11 @@ export class Repository implements Disposable {
this._indexGroup = this._sourceControl.createResourceGroup('index', localize('staged changes', "Staged Changes"));
this._workingTreeGroup = this._sourceControl.createResourceGroup('workingTree', localize('changes', "Changes"));
const onConfigListener = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.showStagedChangesResourceGroup'));
onConfigListener(this.showStagedChangesResourceGroup, this, this.disposables);
this.showStagedChangesResourceGroup();
this.mergeGroup.hideWhenEmpty = true;
this.indexGroup.hideWhenEmpty = true;
this.disposables.push(this.mergeGroup);
this.disposables.push(this.indexGroup);
......@@ -712,6 +715,12 @@ export class Repository implements Disposable {
return this.run(Operation.Config, () => this.repository.config('local', key, value));
}
private showStagedChangesResourceGroup(): void {
const config = workspace.getConfiguration('git');
const gitShowStagedChangesResourceGroup = config.get<string>('showStagedChangesResourceGroup');
this.indexGroup.hideWhenEmpty = !gitShowStagedChangesResourceGroup;
}
@throttle
async status(): Promise<void> {
await this.run(Operation.Status);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册