mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 15:55:15 +01:00
Merge commit 'refs/pull/55976/head' of github.com:Microsoft/vscode into pr/55976
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user