mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
Git - Clear global state if setting is not enabled (#158747)
Clear global state if setting is not enabled
This commit is contained in:
@@ -82,14 +82,19 @@ export class CommitCommandsCenter {
|
||||
private readonly postCommitCommandsProviderRegistry: IPostCommitCommandsProviderRegistry
|
||||
) {
|
||||
const root = Uri.file(repository.root);
|
||||
this.disposables.push(workspace.onDidChangeConfiguration(async e => {
|
||||
|
||||
const onRememberPostCommitCommandChange = async () => {
|
||||
const config = workspace.getConfiguration('git', root);
|
||||
if (!config.get<boolean>('rememberPostCommitCommand')) {
|
||||
await this.globalState.update(repository.root, undefined);
|
||||
}
|
||||
};
|
||||
this.disposables.push(workspace.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration('git.rememberPostCommitCommand', root)) {
|
||||
const config = workspace.getConfiguration('git', root);
|
||||
if (!config.get<boolean>('rememberPostCommitCommand')) {
|
||||
await this.globalState.update(repository.root, undefined);
|
||||
}
|
||||
onRememberPostCommitCommandChange();
|
||||
}
|
||||
}));
|
||||
onRememberPostCommitCommandChange();
|
||||
|
||||
this.disposables.push(postCommitCommandsProviderRegistry.onDidChangePostCommitCommandsProviders(() => this._onDidChange.fire()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user