show "Accept Merge" only for files currently under conflict. (#155822)

While the merge editor shows users can handle merge conflicts outside of it, e.g on the console via `git add <FILE>`. The merge editor should have this graceful and step one is to hide the "Accept Merge" command when the file isn't conflicting anymore

* Adds a git-context key that contains all resource-uri-strings under conflict
* Enable/placement of the Accept Merge command is driven by that
* some merge editor context key sugar
This commit is contained in:
Johannes Rieken
2022-07-21 13:25:23 +02:00
committed by GitHub
parent cef02dae8d
commit bbbae594da
5 changed files with 28 additions and 13 deletions

View File

@@ -2028,6 +2028,9 @@ export class Repository implements Disposable {
// set count badge
this.setCountBadge();
// set mergeChanges context
commands.executeCommand('setContext', 'git.mergeChanges', merge.map(item => item.resourceUri.toString()));
this._onDidChangeStatus.fire();
this._sourceControl.commitTemplate = await this.getInputTemplate();