Skip to content

Skip file transfer for mappings with no differences - #40

Merged
dsaenztagarro merged 1 commit into
masterfrom
39-skip-transfer-no-differences
Apr 7, 2026
Merged

dsaenztagarro merged 1 commit into
masterfrom
39-skip-transfer-no-differences

Conversation

@dsaenztagarro

Copy link
Copy Markdown
Owner

Summary

  • Fix unnecessary file transfers during dotsync pull/push when no differences exist
  • Prevents tools like Neovim from detecting false mtime changes and triggering plugin reloads

Closes #39

Changes

Core fix (lib/dotsync/actions/concerns/mappings_transfer.rb):

  • transfer_mappings now filters valid_mappings through the cached @differs results using filter_map
  • Mappings with no additions, modifications, or removals are skipped entirely
  • No redundant file comparisons — leverages already-computed diffs from the display phase

Tests (spec/dotsync/actions/{pull,push}_action_spec.rb):

  • Updated test fixtures so all mappings expected to be transferred have actual file differences
  • Adjusted expected diff output and confirmation prompt counts to match new fixtures

Version bump: 0.4.1 → 0.4.2

Test plan

  • Full test suite: 537 examples, 0 failures (96.4% line / 82.55% branch coverage)
  • RuboCop: 0 offenses

🤖 Generated with Claude Code

transfer_mappings now filters valid_mappings through the cached @differs
results, skipping mappings that have no additions, modifications, or
removals. This prevents unnecessary file mtime updates that caused tools
like Neovim to reload plugins on every dotsync pull even when nothing
changed.

Closes #39

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dsaenztagarro
dsaenztagarro force-pushed the 39-skip-transfer-no-differences branch from 185cdd2 to 5bf806e Compare April 7, 2026 17:27
@dsaenztagarro
dsaenztagarro merged commit 92565ab into master Apr 7, 2026
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.

Skip file transfer for mappings with no differences

1 participant