Fix rm --exact / --matching not being invoked at all O_o

This commit is contained in:
Vitaliy Filippov
2024-12-28 21:47:00 +03:00
parent 42d40153ff
commit 383712148b
3 changed files with 15 additions and 9 deletions
+14 -5
View File
@@ -431,13 +431,22 @@ static int run(cli_tool_t *p, json11::Json::object cfg)
else if (cmd[0] == "rm")
{
// Remove multiple snapshots and rebase their children
if (cmd.size() > 1)
if (cfg["exact"].bool_value() || cfg["matching"].bool_value())
{
cfg["from"] = cmd[1];
if (cmd.size() > 2)
cfg["to"] = cmd[2];
cmd.erase(cmd.begin(), cmd.begin()+1);
cfg["globs"] = cmd;
action_cb = p->start_rm_wildcard(cfg);
}
else
{
if (cmd.size() > 1)
{
cfg["from"] = cmd[1];
if (cmd.size() > 2)
cfg["to"] = cmd[2];
}
action_cb = p->start_rm(cfg);
}
action_cb = p->start_rm(cfg);
}
else if (cmd[0] == "describe")
{