Repository navigation
Fix push conflicts for non-UTF-8 paths - #4259
Merged
max-sixty merged 2 commits intoSep 25, 2026
Merged
Conversation
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
The byte comparison fixes the false collision, and because it only removes collisions that came from lossy decoding, it doesn't weaken the dirty-target guard. Two follow-ups on the shape (inline):
- After this change,
parse_porcelain_zandRepository::changed_filesare used only by tests. Nothing in production uses them for display, so the PR body's reason for keeping them doesn't apply. Both are now test-only helpers in library code.parse_porcelain_zalso adds a new.expect, and the#[cfg(test)]import inrepository_ext.rsexists only to keep it reachable. - The run-then-fail-on-non-success block is copied into two places instead of being shared. Neither new failure branch appears to have a test, so
codecov/patch, which gates merge here, will probably flag them.
The same lossy decoding also appears outside this diff: list_ignored_entries in src/commands/step/shared.rs decodes ls-files -z output with String::from_utf8_lossy before joining each entry onto the worktree path. With a non-UTF-8 ignored filename, that join builds a path that doesn't exist on disk. That could be a separate follow-up; it doesn't block this PR.
worktrunk-bot
approved these changes
Sep 24, 2026
1 task
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
wt step pushconflict checks.Root cause
ensure_no_target_conflictsdecodedgit status -zandgit diff-tree -zoutput withString::from_utf8_lossybefore comparing paths. Distinct names such ascollision-\xFEandcollision-\xFFboth becamecollision-�, so an unrelated dirty target path could block the push.Verification
cargo run -- hook pre-merge --yespassed locally.codecov/patchpassed on the current head.