Repository navigation
Conversation
fs_write failed while printing a diff for paths that start with ~/ because the literal tilde path was opened. Expand a leading ~ or $HOME before file access, and cover that diff path with a unit test. Co-authored-by: Sharan S <Devil1716@users.noreply.github.com>
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.
Summary
Expand a leading
~or$HOMEinfs_writepath handling so writes (and the printed diff) resolve home the same wayfs_readalready does viasanitize_path_tool_arg.Motivation
Fixes #1932 —
fs_writefailed on paths like~/…while reads already expanded the home prefix.Changes
sanitize_path_tool_argto expand a leading~or$HOME(shared byfs_read/fs_write)$HOMEwrite paths infs_writetestsTest plan
cargo test -p chat_cli --bin chat_cli—fs_write::tests(14),test_tilde_path_expansion,test_format_pathpassedNotes for reviewers
Diff is limited to path sanitization + tests; no unrelated refactors.
Checklist