fix: continue checkout with unavailable encodings#2737
Merged
Conversation
Repositories can declare working-tree encodings unsupported by encoding_rs, such as UTF-32. Checkout previously rejected these declarations before writing any content, causing non-bare clones to fail. Add regression coverage for an unknown encoding with CRLF conversion. Checkout now warns and preserves the output of earlier conversions when the requested encoding is unavailable, while other filter users remain strict by default. This matches Git convert.c encode_to_worktree() and entry.c checkout_entry_ca(): since 107642f (Git 2.18), failed checkout re-encoding is non-fatal and the current blob content is written. Validated with focused gix-filter conversion tests, gix-worktree-state checkout tests, cargo fmt, and cargo check for gix and gix-worktree-state.
…ail on unknown encodings This makes it more obvious, and makes it more likely that tooling using this function won't fail for the same reason, but instead act like Git, while still supporting strict writers or those who want to act differently.
1 task
Sebastian Thiel (Byron)
force-pushed
the
encoding-fallback-pony
branch
from
July 22, 2026 13:12
bdb29d4 to
351523d
Compare
Previously it claimed delay is forbidden, even though it's allowed.
Sebastian Thiel (Byron)
force-pushed
the
encoding-fallback-pony
branch
from
July 22, 2026 13:18
351523d to
2965ab5
Compare
Sebastian Thiel (Byron)
marked this pull request as ready for review
July 22, 2026 13:36
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2965ab5bf3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
…res. Previously it would only ignore unknown filter names in this mode. Co-authored-by: GPT 5.6 <codex@openai.com>
Sebastian Thiel (Byron)
enabled auto-merge
July 22, 2026 14:15
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.
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by Codex GPT-5.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Fixes #1798
Summary
working-tree-encodingnames an unavailable encodingThis follows Git behavior introduced by
107642fe2661236f48b912480e090799e339c512: checkout re-encoding failures are non-fatal and retain the current content.Validation
cargo test -p gix-filter --test filter pipeline::convert_to_worktree -- --nocapturecargo test -p gix-filter --test filter pipeline::convert_to_git -- --nocapturecargo test -p gix-worktree-state --test worktree-state checkout --no-default-features --features parallelcargo check -p gix -p gix-worktree-statecargo fmt --all -- --checkbdb29d41f385found no actionable regression