Skip to content

Conversation

@dsaenztagarro
Copy link
Owner

Resolves #5

…letions

When force=true is used with an 'only' filter, cleanup_folder was deleting
all files in the destination that weren't explicitly ignored, including
unrelated folders that weren't being managed by the mapping. This caused
data loss for folders like cabal/ and ghc/ that weren't in the only list.

The fix adds a check for @mapping.include?(abs_path) to ensure only paths
matching the inclusion filter are cleaned up, leaving unmanaged content intact.

Added comprehensive test coverage:
- Test for preserving unrelated folders (cabal/, ghc/) when using force + only
- Test for only cleaning managed paths specified in only list
- Test for edge case with empty source and unmanaged dest content
- Updated existing test to reflect correct behavior (paths not in only list preserved)

All 326 specs passing with 96.41% line coverage.
- Version bumped from 0.1.22 to 0.1.23
- Updated CHANGELOG.md with critical bug fix details
- Updated Gemfile.lock with new version
- All 326 specs passing with 96.41% line coverage
@dsaenztagarro dsaenztagarro merged commit 9bb16a0 into master Nov 15, 2025
2 checks passed
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.

Fix cleanup with only option

2 participants