@@ -3,6 +3,8 @@
databases are enabled.
* Add credential loading from file, KeePassXC, and Docker/Podman secrets. See the documentation for
more information: https://torsion.org/borgmatic/docs/how-to/provide-your-passwords/
+ * Fix another error in the Btrfs hook when a subvolume mounted at "/" is configured in borgmatic's
+ source directories.
1.9.10
* #966: Add a "{credential ...}" syntax for loading systemd credentials into borgmatic
@@ -299,8 +299,10 @@ def remove_data_source_dumps(hook_config, config, borgmatic_runtime_directory, d
logger.debug(error)
return
- # Remove snapshot parent directory if it still exists (might not exist if snapshot was for '/')
+ # Remove the snapshot parent directory if it still exists. (It might not exist if the
+ # snapshot was for "/".)
snapshot_parent_dir = snapshot_path.rsplit(subvolume.path, 1)[0]
+
if os.path.isdir(snapshot_parent_dir):
shutil.rmtree(snapshot_parent_dir)
@@ -860,7 +860,7 @@ def test_remove_data_source_dumps_with_delete_snapshot_called_process_error_bail
)
-def test_remove_data_source_dumps_with_root_subvolume():
+def test_remove_data_source_dumps_with_root_subvolume_skips_duplicate_removal():
config = {'btrfs': {}}
flexmock(module).should_receive('get_subvolumes').and_return(
(module.Subvolume('/', contained_patterns=(Pattern('/etc'),)),)