Skip to content

fix: fall back when checkout encoding is unavailable#2733

Closed
Sebastian Thiel (Byron) wants to merge 1 commit into
mainfrom
encoding-fallback
Closed

fix: fall back when checkout encoding is unavailable#2733
Sebastian Thiel (Byron) wants to merge 1 commit into
mainfrom
encoding-fallback

Conversation

@Byron

Copy link
Copy Markdown
Member

Tasks

This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.

  • refackiew

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.

Summary

  • Match Git when working-tree-encoding names an unavailable encoding: skip only that encoding stage instead of aborting checkout.
  • Preserve ident, EOL, and smudge filters, and report the tolerated encoding error through checkout outcomes and CLI warnings.
  • Keep conversions into Git strict and offer an explicit strict option for worktree conversion callers.
  • Cover pipeline and clone behavior with SHA-1 and SHA-256 fixtures.

Fixes #1798.

Git compatibility baseline

The behavior was verified against Git a23bace963, using the local Git source checkout. Git's handling originates in commit 107642fe2661236f48b912480e090799e339c512 (convert: add 'working-tree-encoding' attribute).

Validation

  • cargo test -p gix-filter unknown_encoding
  • cargo test -p gix-worktree-state --features sha1,sha256
  • cargo test -p gitoxide-core --features blocking-client
  • cargo test -p gix --test gix --features blocking-network-client,worktree-mutation clone::blocking_io
  • SHA-256 focused clone and filter regressions
  • cargo clippy -p gix-filter --all-targets -- -D warnings
  • cargo clippy -p gix-worktree-state --all-targets --features sha1,sha256 -- -D warnings
  • minimal SHA-1 and SHA-256 gix checks
  • just check
  • Codex commit review (clean after addressing delayed-filter diagnostic timing)

@Byron
Sebastian Thiel (Byron) marked this pull request as ready for review July 21, 2026 15:10
@Byron
Sebastian Thiel (Byron) marked this pull request as draft July 21, 2026 15:10
Non-bare clones aborted when working-tree-encoding named an encoding
that encoding_rs does not provide, such as UTF-32.

Match Git's worktree behavior by skipping only the unavailable encoding
stage while retaining ident, EOL, and smudge processing. Report the
ignored error through checkout outcomes and CLI warnings, default the
plumbing option to this fallback, and retain an explicit strict option.
Conversions into Git remain strict.

Add pipeline and end-to-end clone regressions for both SHA-1 and SHA-256.
The reference behavior was verified against Git a23bace963 and originates
in Git commit 107642f.

Validated with focused crate and clone tests, strict Clippy for the changed
plumbing crates, minimal hash builds, and `just check`.
@Byron

Copy link
Copy Markdown
Member Author

Closed in favor of #2737

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UTF-32 missing encoding for ansible.git @ salsa

2 participants