Repository: vscode
Issue: Git - files.encoding ist ignored for git in diff view if opened as workspace
Labels: bug,git,merge-editor

Type: <b>Bug</b>

- create a git repo
- add settings file with
  {
    "files.encoding": "windows1252"
  }
- create a file with this encoding that contains characters äöü
- commit changes
- open folder as workspace in vscode
- add a change to file
- view changes with diff: 
![image](https://github.com/microsoft/vscode/assets/131866135/32816d46-ecae-48d1-a960-dba74fd4fbf0)
The problem ist that the right side(working tree) is opened with encoding windows1252 and the left side(HEAD) is opend with the wrong encoding utf-8

If opened as folder (not workspace) the diff looks like this: 
![image](https://github.com/microsoft/vscode/assets/131866135/e78e56e4-b8ef-443a-9250-a125893a5a0a)

I debugged the issue and figured out that the difference is caused in: 
https://github.com/microsoft/vscode/blob/1c0a807f45b3ae9293534f32dde1ff1b9eb7708d/src/vs/platform/configuration/common/configurationModels.ts#L933-L937

Here root is only true for the working tree (schema: file) and not for the head (schema: git). 

VS Code version: Code 1.83.0 (e7e037083ff4455cf320e344325dacb480062c3c, 2023-10-03T16:12:16.321Z)
OS version: Windows_NT x64 10.0.19045
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|12th Gen Intel(R) Core(TM) i7-12800H (20 x 1805)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|15.69GB (2.44GB free)|
|Process Argv|--crash-reporter-id 314f81c4-ab42-49ea-bcff-f9aff4f6bebc|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (29)</summary>

Extension|Author (truncated)|Version
---|---|---
pythoncpp-debug|ben|0.3.0
githistory|don|0.6.20
gitlens|eam|14.3.0
remotehub|Git|0.62.0
git-graph|mhu|1.30.0
vscode-docker|ms-|1.26.1
autopep8|ms-|2023.6.0
isort|ms-|2023.10.1
python|ms-|2023.16.0
vscode-pylance|ms-|2023.10.10
jupyter|ms-|2023.9.1102792234
jupyter-keymap|ms-|1.1.2
jupyter-renderers|ms-|1.0.17
vscode-jupyter-cell-tags|ms-|0.1.8
vscode-jupyter-slideshow|ms-|0.1.5
remote-containers|ms-|0.309.0
remote-ssh|ms-|0.106.4
remote-ssh-edit|ms-|0.86.0
remote-wsl|ms-|0.81.7
vscode-remote-extensionpack|ms-|0.24.0
azure-account|ms-|0.11.5
azure-repos|ms-|0.38.0
cmake-tools|ms-|1.15.31
cpptools|ms-|1.17.5
cpptools-extension-pack|ms-|1.3.0
remote-explorer|ms-|0.4.1
remote-repositories|ms-|0.40.0
remote-server|ms-|1.4.3
cmake|twx|0.0.17

(1 theme extensions excluded)

</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
f6dab269:30613381
vscrp:30673768
a9j8j154:30646983
showlangstatbar:30737416
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
copilotsettingc:30839828
synctok:30821570
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30821572
dsvsc015:30845448

```

</details>

<!-- generated by issue reporter -->