Skip to content

Skip apply phase when no differences detected (#41) - #42

Merged
dsaenztagarro merged 1 commit into
masterfrom
41-skip-apply-when-no-differences
Apr 7, 2026
Merged

dsaenztagarro merged 1 commit into
masterfrom
41-skip-apply-when-no-differences

Conversation

@dsaenztagarro

Copy link
Copy Markdown
Owner

Summary

When dotsync pull or push detects no differences, the apply phase (transfer_mappings, cleanup_orphans, execute_hooks) still ran unnecessarily. The main bottleneck was cleanup_orphans calling Find.find on every destination directory with inclusion filters.

Closes #41

Changes

Code

  • pull_action.rb: Guard transfer/cleanup/hooks behind has_differences?; preserve force_hooks via elsif branch
  • push_action.rb: Same pattern for transfer/hooks

Tests (6 new examples)

  • Pull: no-differences + apply skips transfer/cleanup/hooks; shows "Mappings pulled"; force_hooks still works
  • Push: no-differences + apply skips transfer/hooks; shows "Mappings pushed"; force_hooks still works

Test plan

  • bundle exec rspec — 547 examples, 0 failures
  • bundle exec rubocop — passed (pre-commit hook)
  • Coverage: 96.54% line, 83.3% branch (above 95%/80% minimums)

@dsaenztagarro
dsaenztagarro merged commit 002a8e9 into master Apr 7, 2026
0 of 2 checks passed
@dsaenztagarro
dsaenztagarro deleted the 41-skip-apply-when-no-differences branch April 7, 2026 18:29
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 apply phase when no differences detected

1 participant