Repository navigation
Refuse trailing-separator destination and normalize path spelling - #113
Merged
Merged
Conversation
…errors Reject destinations that end with a path separator with exit code 3 and code destination_has_trailing_separator. The raw input is inspected before Windows GetFullPathNameW drops the trailing character, so copy and plan behave the same way on both platforms. Strip reversible \?\C:\ and \?\UNC\ prefixes in display_path on Windows so human-mode errors use the same ordinary spelling regardless of which arm produced them. Fixes #110 Fixes #111
This was referenced Oct 28, 2026
On Unix a backslash is a literal filename character, not a path separator, so the Unix branch only exercises "/" suffixes while Windows still exercises both "/" and "\\". The production check already behaves this way; only the unit test iterated both separators unconditionally.
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.
Two path-UX fixes to the single-file copy flow.
Changes
orbit copyandorbit plannow reject a destination that ends with a path separator. The raw input is inspected before WindowsGetFullPathNameWdrops the trailing character, so copy and plan behave the same way on both platforms. New error code:destination_has_trailing_separator, exit 3.\\?\C:\and\\?\UNC\prefixes are stripped indisplay_path. JSON output is untouched so machine-readable paths stay unambiguous.Tests
paths::tests::rejects_destination_with_trailing_separatorcovers both/and\suffixes.report::tests::display_path_strips_reversible_verbatim_prefixcovers drive, UNC, non-reversible volume, and already-ordinary forms.report::tests::trailing_separator_error_message_names_the_destination.copy_integration::trailing_separator_destination_is_refused_without_creating_a_file.copy_integration::error_messages_use_ordinary_path_spelling_on_windows.cargo testis green locally.Fixes #110
Fixes #111