Skip to content

fix(clone): non-UTF-8 symlink targets + reject unsupported --depth (F1/P1)#63

Merged
russellromney merged 1 commit into
mainfrom
fix/clone-correctness
Jun 26, 2026
Merged

fix(clone): non-UTF-8 symlink targets + reject unsupported --depth (F1/P1)#63
russellromney merged 1 commit into
mainfrom
fix/clone-correctness

Conversation

@russellromney

Copy link
Copy Markdown
Owner

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_bytes on 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 history

git clone --depth 3 quietly 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 the ripclone clone CLI now reject N>1 with a clear error rather than silently doing the wrong thing. --depth 1 and full clones are unchanged.

Full cargo test green; cargo fmt --check + clippy --all-targets -D warnings clean.

🤖 Generated with Claude Code

…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>
@russellromney russellromney merged commit c8f4b2d into main Jun 26, 2026
7 checks passed
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.

1 participant