mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
set git.mergeChanges context key for all repos, not just one (#162339)
fixes https://github.com/microsoft/vscode/issues/162224
This commit is contained in:
@@ -450,7 +450,21 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand
|
||||
.forEach(p => this.eventuallyScanPossibleGitRepository(p));
|
||||
};
|
||||
|
||||
const statusListener = repository.onDidRunGitStatus(checkForSubmodules);
|
||||
const updateMergeChanges = () => {
|
||||
// set mergeChanges context
|
||||
const mergeChanges: Uri[] = [];
|
||||
for (const { repository } of this.openRepositories.values()) {
|
||||
for (const state of repository.mergeGroup.resourceStates) {
|
||||
mergeChanges.push(state.resourceUri);
|
||||
}
|
||||
}
|
||||
commands.executeCommand('setContext', 'git.mergeChanges', mergeChanges);
|
||||
};
|
||||
|
||||
const statusListener = repository.onDidRunGitStatus(() => {
|
||||
checkForSubmodules();
|
||||
updateMergeChanges();
|
||||
});
|
||||
checkForSubmodules();
|
||||
|
||||
const dispose = () => {
|
||||
@@ -466,6 +480,7 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand
|
||||
|
||||
const openRepository = { repository, dispose };
|
||||
this.openRepositories.push(openRepository);
|
||||
updateMergeChanges();
|
||||
this._onDidOpenRepository.fire(repository);
|
||||
}
|
||||
|
||||
|
||||
@@ -2103,9 +2103,6 @@ export class Repository implements Disposable {
|
||||
// set count badge
|
||||
this.setCountBadge();
|
||||
|
||||
// set mergeChanges context
|
||||
commands.executeCommand('setContext', 'git.mergeChanges', merge.map(item => item.resourceUri));
|
||||
|
||||
this._onDidChangeStatus.fire();
|
||||
|
||||
this._sourceControl.commitTemplate = await this.getInputTemplate();
|
||||
|
||||
Reference in New Issue
Block a user