Repository navigation
Conversation
|
Warning Review limit reachedNext included review available in 48 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
A symlink in the diff (new file mode 120000, or index ... 120000 for a retargeted link) was written as a regular file containing the target path plus a newline, so the sub-PR changed the entry type. Read the mode from the index line too, create symlinks with symlink_to, never write through an existing link, and unlink dangling links on removal.
60ae860 to
fb198cc
Compare
…mlinks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015rnEEjXWDBdePRhKMmZr1w
|
This change is already in Generated by Claude Code |
Problem
A symlink in the diff —
new file mode 120000, orindex a..b 120000for a retargeted link — was written into the sub-PR worktree as a regular file whose content was the target path plus a newline. The sub-PR changed the entry's type (100644 blobwhere the feature branch had120000), sogit diff feature <sub-pr>showedlink | 2 +-. Dangling symlinks also survived deletion becausePath.exists()is false for them.Fix
target_file_modesreads the mode from theindex <old>..<new> MODEline as well asnew mode/new file mode, and reports symlinks alongside regular files.symlink_to(content.rstrip("\n"))(git stores the target as the blob), unlinks any existing entry first (regular file being converted, old link), never writes through an existing link, and removes dangling links on deletion.Verified end to end in real repos: new / retargeted / deleted / dangling symlink, regular-file→symlink and symlink→regular-file conversions, and an ordinary modified file — every sub-PR
git ls-tree -ris byte-identical to the feature branch.Tests
target_file_modes: new symlink, retargeted symlink from the index line, unchanged regular mode from the index line. Worker: new symlink created as a link, regular-file→symlink conversion, plain-file fallback when no mode info.Local review: 5/5. 456 tests pass, ruff clean. Stacked on #90.