microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.97k stars 29.19k forks source link

git: Staging a selection stages entire block #230423

Open AeonSolstice opened 4 weeks ago

AeonSolstice commented 4 weeks ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Make a multiline change to a file in a git repo
  2. Goto Source Control view and click the file under Changes
  3. Observe that the actions in between the diff editors are -> Revert Block and + Stage Block
  4. Now select a subset of the change and observe the actions change to -> Revert Selection and + Stage selection
  5. Click + Stage selection
  6. The entire change/block gets staged instead of just the selected lines

Weirdly enough, it only happens for some changes in some files

lszomoru commented 4 weeks ago

@hediet could you please take a look at this? Thanks!

AeonSolstice commented 4 weeks ago

To be clear, I am not sure if this is due to the update, as it is the first time I tried to stage a part of a change