Rename ResolveSameDir to ResolveSamePath and fix destination error handling#1
Closed
Rename ResolveSameDir to ResolveSamePath and fix destination error handling#1
Conversation
- Renamed ResolveSameDir → ResolveSamePath for accuracy (handles both same-file and same-directory) - Added DestLocationInvalid error variant to ResolveError set - Fixed dest_stat error handler to return DestLocationInvalid instead of SourceLocationInvalid - Added DestLocationInvalid handler in main.zig with appropriate error message - Replaced three backend if blocks with exhaustive switch statement in main.zig - All changes validated with zig build --release=fast and zig build test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: scixor <27860105+scixor@users.noreply.github.com>
…ndling Agent-Logs-Url: https://github.com/scixor/cp-zig/sessions/96b9efb9-96f6-4d58-b9d6-f57a03783d9a Co-authored-by: scixor <27860105+scixor@users.noreply.github.com>
Claude created this pull request from a session on behalf of
scixor
April 6, 2026 04:58
View session
- Restored FIXME comment with (¬`‸´¬) emoji - Restored commented-out evented backend initialization code - Kept the exhaustive switch statement structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: scixor <27860105+scixor@users.noreply.github.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: scixor <27860105+scixor@users.noreply.github.com>
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.
The
ResolveSameDirerror was misleading since it's returned for both same-file and same-directory detection. Additionally, the destination stat error handler incorrectly returnedSourceLocationInvalidwhen the destination file type was unsupported.Changes
Renamed error variant:
ResolveSameDir→ResolveSamePathacross all error sites insrc/file.zig,src/copy.zig, andsrc/main.zigAdded
DestLocationInvaliderror: New variant inResolveErrorset with corresponding handler insrc/main.zigthat reports unsupported destination file types correctlyFixed destination stat error: Changed
src/file.zig:109to returnDestLocationInvalidinstead ofSourceLocationInvalidwhen destination file kind is not supportedBackend dispatch improvement: Replaced three sequential
ifchecks followed byunreachablewith exhaustiveswitchstatement insrc/main.zig, ensuring compiler-enforced exhaustiveness