test(snapshot): add extended test cases for revert functionality #9408
+608
−19
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 #8098
Summary
This PR extends the test coverage for the snapshot revert functionality and fixes unicode/emoji filename support, building upon the fix in PR #8631 by @Twisted928.
Bug Fix: Unicode Filename Support
The original fix in PR #8631 didn't handle unicode filenames (Chinese, Japanese, Korean, emoji) correctly on Windows. This was due to Bun's shell template (`$``) having issues passing non-ASCII characters to git.
Solution: Use
Bun.spawninstead of shell templates for git commands that involve file paths, ensuring reliable unicode support across all platforms.Added Test Cases (8 new tests - all passing)
Code Changes
runGitCommandhelper - UsesBun.spawnfor reliable unicode filename handlingcore.quotepath=false- Configured in git init and all git commands to prevent path escapingAcknowledgments
This PR builds on the excellent work by @Twisted928 in PR #8631. The original fix correctly handles the absolute path issue - this PR extends it with unicode support and comprehensive test coverage.
Co-authored-by: Twisted 46923858+Twisted928@users.noreply.github.com