Skip to content

fix(sync): compare link destination entries for overlap - #73

Open
srnnkls wants to merge 1 commit into
mainfrom
fix/link-destination-overlap
Open

fix(sync): compare link destination entries for overlap#73
srnnkls wants to merge 1 commit into
mainfrom
fix/link-destination-overlap

Conversation

@srnnkls

@srnnkls srnnkls commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Keep the final destination entry when checking link-mode overlap: canonicalize its parent, not the final symlink. Distinct targets can link to the same source on repeat sync. Copy-mode physical normalization and ancestor-symlink checks are unchanged.

Regressions cover repeat sync for file and collapsed directory links, equal destinations, and aliased target parents.

Validation on Rust 1.96: full cargo test, strict Clippy, and formatting checks passed. The initial full test build ran out of disk space; clearing the package build cache and rerunning succeeded.

Independent of #72; based directly on main.

Copilot AI lite review requested due to automatic review settings September 9, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is tightly scoped, aligns with the stated link-mode overlap semantics, and is backed by targeted regression tests for the reported repeat-sync and aliasing scenarios.

Pull request overview

This PR fixes cross-target overlap detection for link-mode deployments by preserving the destination’s final path component (the symlink itself) while still canonicalizing its parent directory, preventing false overlap rejections on repeat syncs when different targets link to the same source.

Changes:

  • Adjust cross-target overlap normalization for DeployMode::Link to normalize only the destination parent, not the final symlink entry.
  • Thread parsed source metadata into overlap checking to determine deploy mode per binding.
  • Add Unix-only regression tests covering repeat sync with disjoint link targets and rejection when targets share a destination via identical or symlink-aliased parents.
File summaries
File Description
src/sync/mod.rs Updates overlap detection to avoid resolving the final symlink destination when comparing physical deploy paths for link-mode sources.
src/sync/tests.rs Adds regressions ensuring repeat link syncs don’t spuriously fail and that true destination overlaps (including via symlinked parents) are still rejected.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants