mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
avoid calling setContext when not necessary (#160297)
* avoid calling setContext when not necessary * Update extensions/git/src/repository.ts
This commit is contained in:
@@ -833,8 +833,12 @@ export class Repository implements Disposable {
|
||||
this.inputBox.value = rebaseCommit.message;
|
||||
}
|
||||
|
||||
const shouldUpdateContext = !!this._rebaseCommit !== !!rebaseCommit;
|
||||
this._rebaseCommit = rebaseCommit;
|
||||
commands.executeCommand('setContext', 'gitRebaseInProgress', !!this._rebaseCommit);
|
||||
|
||||
if (shouldUpdateContext) {
|
||||
commands.executeCommand('setContext', 'gitRebaseInProgress', !!this._rebaseCommit);
|
||||
}
|
||||
}
|
||||
|
||||
get rebaseCommit(): Commit | undefined {
|
||||
@@ -844,6 +848,10 @@ export class Repository implements Disposable {
|
||||
private _mergeInProgress: boolean = false;
|
||||
|
||||
set mergeInProgress(value: boolean) {
|
||||
if (this._mergeInProgress === value) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._mergeInProgress = value;
|
||||
commands.executeCommand('setContext', 'gitMergeInProgress', value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user