Fix spurious error when checking out a PR with untracked files and add "never show again" option#7306
Merged
Fix spurious error when checking out a PR with untracked files and add "never show again" option#7306
Conversation
…files Co-authored-by: rebornix <876920+rebornix@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Spurious error when checking out a PR with untracked files
Fix spurious error when checking out a PR with untracked files
Jul 16, 2025
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Contributor
Author
Done! I've addressed both requests:
The dialog now shows three options: "Stash changes", "Discard changes", and "Don't show again". Changes committed in 5561d52. |
Copilot
AI
changed the title
Fix spurious error when checking out a PR with untracked files
Fix spurious error when checking out a PR with untracked files and add "never show again" option
Aug 4, 2025
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Contributor
Author
Done! Changed from VS Code setting to extension local state (PersistentState) for storing the "never show again" preference. The implementation now:
Changes committed in dfdad79. |
alexr00
approved these changes
Aug 5, 2025
Tyriar
approved these changes
Aug 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
handleUncommittedChangesfunction was showing a warning dialog for all uncommitted changes, including untracked files. However, untracked files typically don't conflict with PR checkout unless the PR branch creates a file at the same path.This caused unnecessary friction for users who commonly have untracked files in their workspace (like environment configs, temporary files, etc.) when switching between PRs.
Changes Made
handleUncommittedChangesto filter out files withStatus.UNTRACKEDstatus before checking for conflictsBefore vs After
Before: Warning appears for any uncommitted changes including untracked files

After:
Implementation Details
The "never show again" functionality uses the extension's
PersistentStateinfrastructure:PersistentState.fetch()checks if user has disabled warningsPersistentState.store()saves the preference when user clicks "Don't show again"Test Cases
This is a minimal change that maintains existing behavior for legitimate conflicts while eliminating spurious warnings for untracked files and giving users control over the dialog experience.
Fixes #7294.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.