fix(clone): non-UTF-8 symlink targets + reject unsupported --depth (F1/P1)#63
Merged
Conversation
…1/P1) F1: a symlink whose target blob isn't valid UTF-8 aborted the entire clone (`str::from_utf8(content)?`). Symlink targets are arbitrary bytes; build the target straight from the raw bytes via `OsStr::from_bytes` on unix (lossy fallback off-unix), so such a repo clones with the target preserved byte-for-byte. Applied in both the io_uring/POSIX writer and the archive extract path. Adds the missing test (F3): a non-UTF-8 symlink target round-trips. P1: `git clone --depth N` for N>1 was silently served as full history with no `.git/shallow` — git then treats the clone as complete, which is quietly wrong. Only depth 1 (shallow) and depth 0 (full) are implemented, so both the git remote helper and the `ripclone clone` CLI now reject N>1 with a clear error instead. (`--depth 1` and full clones are unchanged.) Refs: ADVERSARIAL_REVIEW_2026-06-25.md F1/F3/P1 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
From the adversarial review (
ADVERSARIAL_REVIEW_2026-06-25.md), the clone-correctness findings.F1 — non-UTF-8 symlink target aborted the whole clone
A symlink whose target blob isn't valid UTF-8 hit
str::from_utf8(content)?and failed the entire clone. Symlink targets are arbitrary bytes, so we now build the target straight from the raw bytes (OsStr::from_byteson unix; lossy fallback off-unix) in both the io_uring/POSIX worktree writer and the archive extract path. New test (F3): a non-UTF-8 target round-trips byte-for-byte.P1 —
--depth N(N>1) silently served full historygit clone --depth 3quietly returned full history with no.git/shallow, so git recorded it as a complete clone. Only depth 1 (shallow) and depth 0 (full) are implemented, so the git remote helper and theripclone cloneCLI now reject N>1 with a clear error rather than silently doing the wrong thing.--depth 1and full clones are unchanged.Full
cargo testgreen;cargo fmt --check+clippy --all-targets -D warningsclean.🤖 Generated with Claude Code