mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Bug
- Fixed GC bug that attempted to clean up dangling dependencies but actually failed to update the tasks.
This commit is contained in:
parent
8823ba5bfa
commit
2708b37ce5
1 changed files with 6 additions and 6 deletions
12
src/TDB.cpp
12
src/TDB.cpp
|
@ -612,9 +612,6 @@ int TDB::gc ()
|
||||||
std::vector <Task> ignore;
|
std::vector <Task> ignore;
|
||||||
loadPending (ignore, filter);
|
loadPending (ignore, filter);
|
||||||
|
|
||||||
// TODO This whole idea of removing dangling dependencies is suspect. I'm not
|
|
||||||
// sure it should be included.
|
|
||||||
|
|
||||||
// Search for dangling dependencies. These are dependencies whose uuid cannot
|
// Search for dangling dependencies. These are dependencies whose uuid cannot
|
||||||
// be converted to an id by TDB.
|
// be converted to an id by TDB.
|
||||||
std::vector <std::string> deps;
|
std::vector <std::string> deps;
|
||||||
|
@ -625,14 +622,17 @@ int TDB::gc ()
|
||||||
deps.clear ();
|
deps.clear ();
|
||||||
task->getDependencies (deps);
|
task->getDependencies (deps);
|
||||||
foreach (dep, deps)
|
foreach (dep, deps)
|
||||||
|
{
|
||||||
if (id (*dep) == 0)
|
if (id (*dep) == 0)
|
||||||
{
|
{
|
||||||
task->removeDependency (*dep);
|
task->removeDependency (*dep);
|
||||||
|
++count_pending_changes;
|
||||||
context.debug ("GC: Removed dangling dependency "
|
context.debug ("GC: Removed dangling dependency "
|
||||||
+ *dep
|
+ task->get ("uuid")
|
||||||
+ " from "
|
+ " -> "
|
||||||
+ task->get ("uuid"));
|
+ *dep);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue