Repository: vscode
Issue: "Accept all changes from .." button in merge editor duplicates non-conflicting changes
Labels: bug,merge-editor

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: This requires the git extension which, I think, is enabled by default.

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 
```sh
$ code --version
1.95.3
f1a4fb101478ce6ec82fe9627c43efbf9e98c813
x64
```
- OS Version: `6.11.3-1-siduction-amd64`

Steps to Reproduce:

1. Extract the reproducing example in [vscodebug.tar.gz](https://github.com/user-attachments/files/17791046/vscodebug.tar.gz)
2. The archive contains one git repository called `vscodebug` and the checked out branch should be `feature`. Check out that branch if this is not the case.
3. Open `vscodebug/` in vscode and trust the contents to enable git functionality.
4. Instruct vscode to rebase the current branch (`feature`) onto `main`.
5. There should be a single conflict in `myfile`.
6. Open `myfile` (without using the merge editor) to observe one (and not two) conflicting changes at the beginning of the file: 2x `preamble` versus 1x `preamble`.
7. Now open `myfile` in the merge editor and observe that it still only counts a single conflict (top right status bar of the bottom file view) but also that it highlights the non-conflicting addition of "new text" in a similar style to that of the actual conflict.  
8. Click "Accept all changes from Right".
9. Observe the addition of "new text" being duplicated despite it being exactly the same in both branches and despite it not even being counted as a conflict by vscode itself.

This behavior is highly surprising. I don't see any use for a button that performs the action that vscode performs here. Git users would likely be familiar with `--ours` or `--theirs` but those are exclusive, not additive. I propose that the button be replaced by "Resolve all conflicts with changes from Right" which would leave alone those parts that vscode correctly identified as non-conflicting.

There is an additional, related behavior of the merge editor that I have not been able to generate a minimal reproducing example for: it is sometimes the case that in situations such as in `myfile` where `preamble` was accidentally added twice in the rebase's target branch and only once in the current branch, clicking "Accept all changes from Right" (i.e. the single addition) actually generates two additions of the line. It seems to me that vscode tries to do something smart by finding the commonalities between the branches (a single addition) but when the button is pressed it interprets it as the user's which to add the line again even though it apparently already part of the code that vscode managed to merge all by itself. I was unable to reproduce this in my example so I cannot demonstrate this easily.