{{ message }}
Repository navigation
Git - show untracked files in folders when viewing a stash - #343202
Open
Spoko Dev (spokodev) wants to merge 1 commit into
Open
Spoko Dev (spokodev) wants to merge 1 commit into
Spoko Dev (spokodev) wants to merge 1 commit into
Conversation
Contributor
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Fixes viewing stashed untracked files in subfolders by making Repository.getObjectFiles list tree entries recursively, and adds a regression test for the stash untracked-files commit case.
Changes:
- Update
Repository.getObjectFilesto calllstreewith{ recursive: true }. - Add an integration-style test that stashes untracked files at root and in a folder and validates
getObjectFiles('stash@{0}^3').
Review effort: Lite
This branch has not been deployed
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.


Fixes #343201
Repository.getObjectFileslists the stash's untracked-files commit withgit ls-treewithout-r, so_viewStashonly recognises untracked files at the repository root. Files in folders are diffed against the stash commit, where they don't exist, and drop out of the View Stash editor. This passes{ recursive: true }tolstree;getObjectFileshas no other caller.Added a test in
extensions/git/src/test/git.test.tsthat stashesfile.txtandfolder/file.txtwith--include-untrackedand checks thatgetObjectFiles('stash@{0}^3')returns both. It fails without the change (folderis returned instead offolder/file.txt).How to test: follow the steps in #343201. With VS Code 1.143.0, View Stash shows
top.txtand the tracked file only; with this change applied to the built git extension it also showssrc/feature/new.ts.With many untracked files in a stash,
_viewStashnow compares every change against a longer list (stashUntrackedFiles.find(...)withpathEquals). I left that lookup as it is to keep this change small and keep thepathEqualssemantics.