Fix: link uninstall deletes non-symlinked local files #2112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request improves the robustness of the
link_uninstallmethod inmackup/application.pyby ensuring it only processes Mackup files that are valid symbolic links pointing to the correct home file. It also adds comprehensive tests to verify the new behavior, including handling cases where the Mackup file is not a symlink or points to the wrong target.Robustness and correctness improvements
link_uninstallmethod to skip and warn when a Mackup file is not a symbolic link or does not point to the expected home file, preventing unintended file operations.Test coverage enhancements
test_link_uninstall_mackup_not_a_linkto verify that non-symlink Mackup files are skipped and a warning is printed.test_link_uninstall_mackup_points_to_wrong_targetto check that symlinks pointing to the wrong target are also skipped with a warning.test_link_uninstall_mackup_points_correctlyto confirm that normal operation proceeds when the symlink points to the correct home file.Fixes #2111