Skip to content

Fix wrong file list when creating PR#8468

Merged
alexr00 merged 4 commits intomainfrom
copilot/fix-wrong-list-of-files
Feb 4, 2026
Merged

Fix wrong file list when creating PR#8468
alexr00 merged 4 commits intomainfrom
copilot/fix-wrong-list-of-files

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

When creating a new PR, the wrong list of files was displayed. Switching the base branch and back would show the correct files.

Root Cause

CreatePullRequestDataModel constructor initialized _compareBranch to baseBranch instead of compareBranch:

// Before (bug)
this._compareBranch = baseBranch;

// After (fix)
this._compareBranch = compareBranch;

This caused the file diff to use incorrect branches before setCompareBranch() completed async initialization, and the repository state listener to check against the wrong branch.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /opt/hostedtoolcache/node/20.20.0/x64/bin/node node ./out/src/test/runTests.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>wrong list of files when creating PR</issue_title>
<issue_description>
Type: Bug

when creating new PR wrong list of files are displayed.
to overcome this issue need to change destination branch to different branch and than return it back.

Extension version: 0.126.0
VS Code version: Code 1.108.2 (c9d77990917f3102ada88be140d28b038d1dd7c7, 2026-01-21T13:52:09.270Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (8 x 3392)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.89GB (4.89GB free)
Process Argv --crash-reporter-id d3822b2e-a121-4377-ba1b-904ab9e2332e
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31436602
aj953862:31281341
b6b4d950:31327385
6abeh943:31336334
envsactivate1:31353494
cloudbuttont:31379625
3efgi100_wstrepl:31403338
use-responses-api:31390855
ec5jj548:31422691
cmp-ext-treat:31426748
cp_cls_c_966_ss:31454199
c0683394:31419495
nes-autoexp-10:31446583
a5gib710:31434435
rename_enabled:31436409
7a04d226_do_not_restore_last_panel_session:31438103
anthropic_thinking_t:31432745
h0hdh950:31428394
cp_cls_c_1081:31454833
copilot-nes-oct-trt:31432596
ia-use-proxy-models-svc:31452481
nes-slash-models-on:31441832
nes-set-to-on:31441941
a43f0574:31442827
ts_provider_disabled:31446105
nes-conv-2-2:31447849
nes-extended-on:31455476

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 3, 2026 09:44
…orrectly

The constructor was incorrectly initializing _compareBranch to baseBranch
instead of the actual compareBranch parameter. This caused the file diff
comparison to potentially use wrong branches before setCompareBranch completed
its async initialization, resulting in displaying the wrong list of files
when creating a PR.

Co-authored-by: alexr00 <[email protected]>
Copilot AI changed the title [WIP] Fix wrong list of files when creating PR Fix wrong file list when creating PR Feb 3, 2026
Copilot AI requested a review from alexr00 February 3, 2026 09:49
@alexr00 alexr00 marked this pull request as ready for review February 4, 2026 11:37
Copilot AI review requested due to automatic review settings February 4, 2026 11:37
@alexr00 alexr00 enabled auto-merge (squash) February 4, 2026 11:37
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the bug where the "Create Pull Request" view initially showed the wrong list of changed files until the base branch was toggled.

Changes:

  • Initialize CreatePullRequestDataModel._compareBranch with the compareBranch argument instead of baseBranch, ensuring the initial diff and state listener reference the correct compare branch.
  • Keep the async setCompareBranch initialization and repository state listener behavior intact, so subsequent updates still rely on the correct compare branch.

@alexr00 alexr00 merged commit 73977b4 into main Feb 4, 2026
12 checks passed
@alexr00 alexr00 deleted the copilot/fix-wrong-list-of-files branch February 4, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wrong list of files when creating PR

4 participants