Git - fix wrong file count in conflict and discard dialogs#302734
Open
xingsy97 wants to merge 1 commit intomicrosoft:mainfrom
Open
Git - fix wrong file count in conflict and discard dialogs#302734xingsy97 wants to merge 1 commit intomicrosoft:mainfrom
xingsy97 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes two user-facing dialog count/name issues in the built-in Git extension so warnings accurately reflect the set of files actually affected (unresolved merge conflicts and permanently-deleted resources).
Changes:
- Update
git.stageAllMergewarning dialog to use theunresolvedset (count + single-file basename) instead of the broadermergeset. - Update trash-deletion fallback dialog to display
toClean.length(files that will be permanently deleted) instead ofresources.length(all inputs).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| extensions/git/src/repository.ts | Fixes “Delete All {n} Files” to reflect the actual permanently-deleted file count (toClean). |
| extensions/git/src/commands.ts | Fixes merge-conflict staging warning to reference the unresolved conflict set for both plural/singular cases. |
5caea1f to
06486f5
Compare
06486f5 to
d46eba8
Compare
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.
Fix two dialog message bugs in the git extension:
1.
stageAllMergewarning shows wrong count and filenamecategorizeResourceByResolution()splits merge resources intomerge(all),unresolved(still have conflict markers),resolved, anddeletionConflicts. The warning dialog usedmerge.lengthandmerge[0]instead ofunresolved.lengthandunresolved[0].Before:
After:
The nearby
stagecommand already usesunresolvedcorrectly.2. Trash fallback dialog shows wrong file count
When trash deletion fails, the fallback confirmation used
resources.length(all selected resources) instead oftoClean.length(only untracked/ignored files to permanently delete).Before:
git checkout)After: