Skip to content

fix(portable): CONFLICT on real-directory dst in link_or_copy (CC-104u)#100

Merged
screenleon merged 2 commits into
mainfrom
cc-104u-link-dir-conflict
May 19, 2026
Merged

fix(portable): CONFLICT on real-directory dst in link_or_copy (CC-104u)#100
screenleon merged 2 commits into
mainfrom
cc-104u-link-dir-conflict

Conversation

@screenleon
Copy link
Copy Markdown
Owner

Summary

  • link_or_copy() in scripts/lib/portable.sh did not explicitly guard against a real (non-symlink) directory dst; on some platforms (observed on Git Bash / Windows), [[ -e "$dst" ]] may not intercept a real directory before ln -s "$src" "$dst" runs, causing ln to create a link inside the directory (dst/basename(src)) instead of at dst itself
  • Added [[ -d "$dst" && ! -L "$dst" ]] precheck immediately after the symlink branch, returning rc=2 (CONFLICT) with a clear diagnostic message
  • Added case_link_or_copy_dst_is_real_dir regression test covering: rc=2, "real directory" in stderr, directory not replaced, no accidental dst/src.txt creation

Test plan

  • bash scripts/test-portable.sh — 19 passed, 0 failed (including new case)
  • PR-gate express: critic approve, qa-tester approve — Final: GO

🤖 Generated with Claude Code

screenleon and others added 2 commits May 19, 2026 15:33
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…CC-104u

- test-install.sh pm-real-dir-*: update assertion from "is not a symlink" to "is a real directory" to match new link_or_copy guard message
- BACKLOG.md: add CC-104u body section (✅ 2026-05-19, See: pr:#100) required by validator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@screenleon screenleon merged commit 8ff8888 into main May 19, 2026
15 checks passed
@screenleon screenleon deleted the cc-104u-link-dir-conflict branch May 19, 2026 07:09
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