Skip to content

Fix backup to respect only/ignore filters#38

Merged
dsaenztagarro merged 1 commit into
masterfrom
fix/backup-respect-only-ignore-filters
Mar 22, 2026
Merged

Fix backup to respect only/ignore filters#38
dsaenztagarro merged 1 commit into
masterfrom
fix/backup-respect-only-ignore-filters

Conversation

@dsaenztagarro
Copy link
Copy Markdown
Owner

Summary

  • Replaced cp_r_regular_files with FileTransfer reuse — backup now creates a mapping with src=dest, dest=backup_path preserving original only/ignore filters
  • Removed ~15 lines of duplicated traversal code (cp_r_regular_files)
  • Added 3 test cases: backup with only filter, ignore filter, and permission-restricted files outside filter

Closes #37

Test plan

  • All 541 existing tests pass (0 failures)
  • 3 new backup filter tests pass
  • Coverage: 96.52% line, 82.95% branch
  • Manual: dotsync pull --apply -y no longer crashes on ~/.config/claude/plugins/
  • Manual: rm -rf ~/.local/share/dotsync/backups/ to clean up bloated backups

🤖 Generated with Claude Code

Backup was copying entire destination directories ignoring the mapping's
only/ignore filters, causing permission crashes on restricted files
(e.g. .git objects) and wasting disk space. Replaced cp_r_regular_files
with FileTransfer reuse by creating a backup mapping that preserves the
original filters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dsaenztagarro dsaenztagarro merged commit 864ccd2 into master Mar 22, 2026
@dsaenztagarro dsaenztagarro deleted the fix/backup-respect-only-ignore-filters branch March 22, 2026 15:11
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.

Backup ignores only/ignore filters causing permission crashes

1 participant