Repository: vscode
Issue: Git - git.rebasewhensync setting attempts a rebase when there is nothing to pull
Labels: feature-request,git

Type: <b>Bug</b>

1. Use git.rebasewhensync: true.
2. Create branch 'test' from Master, commit something to branch 'test'
3. Commit something to Master
4. Switch to branch 'test'
5. Merge changes from Master to 'test' branch. Merge-commit is created
6. Press 'Sync' button.
EXPECTED: changes are pushed, Merge commit is preserved
ACTUAL: rebase is performed, Merge commit is not present

For me this seems like a duplicate of #149124

VS Code version: Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T04:27:29.066Z)
OS version: Windows_NT x64 10.0.22000
Modes:
Sandboxed: No

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz (16 x 3792)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<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>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off|
|Load (avg)|undefined|
|Memory (System)|31.82GB (6.53GB free)|
|Process Argv|--crash-reporter-id 29c5a4ee-6c8e-43e6-b5dc-b3efa808b624|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (15)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-pull-request-azdo|ank|0.0.25
vscode-css-modules|cli|0.4.2
csharpier-vscode|csh|1.3.5
vscode-eslint|dba|2.2.6
gitlens|eam|13.1.1
prettier-vscode|esb|9.10.3
dotnet|for|0.0.4
dotnet-test-explorer|for|0.7.8
vscode-scss|mrm|0.10.0
vscode-docker|ms-|1.23.1
csharp|ms-|1.25.2
playwright|ms-|1.0.1
remote-containers|ms-|0.262.3
remote-wsl|ms-|0.72.0
vscode-jest|Ort|4.6.0


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
pyindex848cf:30577861
nodejswelcome1:30587005
2e4cg342:30602488
gswce1:30612156
3d0df643:30613357
dbltrim-noruby:30604474
89544117:30613380

```

</details>

<!-- generated by issue reporter -->

<details><summary>Log of git commands when pressing 'Sync'</summary>

```
2022-12-05 12:06:53.725 [info] > git log --oneline --cherry feature/36965-add-is-current-property...feature/36965-add-is-current-property@{upstream} -- [36ms]
2022-12-05 12:06:55.026 [info] > git ls-files --stage -- ***.ci\azure-pipelines.yml [25ms]
2022-12-05 12:06:55.055 [info] > git cat-file -s d2b5b12bec057ef5202fc2f8a8962c7b59a54d8a [27ms]
2022-12-05 12:06:55.099 [info] > git show --textconv :.ci/azure-pipelines.yml [35ms]
2022-12-05 12:06:55.308 [info] > git pull -r origin feature/36965-add-is-current-property [1579ms]
2022-12-05 12:06:55.308 [info] From https://dev.azure.com/****
 * branch            feature/36965-add-is-current-property -> FETCH_HEAD
Rebasing (1/1)

[KSuccessfully rebased and updated refs/heads/feature/36965-add-is-current-property.
2022-12-05 12:06:56.552 [info] > git ls-files --stage -- ***\.ci\azure-pipelines.yml [24ms]
2022-12-05 12:06:56.583 [info] > git cat-file -s d2b5b12bec057ef5202fc2f8a8962c7b59a54d8a [28ms]
2022-12-05 12:06:56.627 [info] > git show --textconv :.ci/azure-pipelines.yml [37ms]
2022-12-05 12:06:57.202 [info] > git push origin feature/36965-add-is-current-property:feature/36965-add-is-current-property [1891ms]
2022-12-05 12:06:57.202 [info] To https://dev.azure.com/***
   26dd442..c95e2aa  feature/36965-add-is-current-property -> feature/36965-add-is-current-property

```

</details>