]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
take into account subvolume hierarchy when comparing paths in probe_target 1022/head
authorifomin <ifomin@gispro.ru>
Sat, 21 Jun 2025 14:49:42 +0000 (17:49 +0300)
committerifomin <ifomin@gispro.ru>
Sat, 21 Jun 2025 14:49:42 +0000 (17:49 +0300)
client/snbk/TheBigThing.cc

index 47e9c2ef0c240f402c3241ca7e8a9647720938e8..0ccc62060971653571f54698a2f4dffc155f6adc 100644 (file)
@@ -326,6 +326,11 @@ namespace snapper
        if (target_path != mount_point)
            start = target_path.substr(mount_point.size() + 1) + "/";
 
+       static const regex subvol_regex("\\[(.*?)\\]");
+       smatch subvol;
+       if (regex_search(cmd_findmnt.get_source(), subvol, subvol_regex))
+               start = subvol[1].str().substr(1) + "/" + start;
+
        if (verbose)
            cout << _("Probing extra information for target snapshots.") << endl;