mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-25 12:17:20 +02:00
Enhancement
- More consistent test of when adding or deleting a dependency. - Update one unit test.
This commit is contained in:
parent
20ae5fed81
commit
5ffb65b5ac
2 changed files with 8 additions and 1 deletions
|
@ -801,6 +801,11 @@ void Task::addDependency (const std::string& uuid)
|
|||
if (uuid == get ("uuid"))
|
||||
throw std::string (STRING_TASK_DEPEND_ITSELF);
|
||||
|
||||
// Check that uuid is resolvable.
|
||||
int id = context.tdb2.pending.id (uuid);
|
||||
if (id == 0)
|
||||
throw format (STRING_TASK_DEPEND_MISS_CREA, id);
|
||||
|
||||
// Store the dependency.
|
||||
std::string depends = get ("depends");
|
||||
if (depends != "")
|
||||
|
@ -837,6 +842,8 @@ void Task::removeDependency (const std::string& uuid)
|
|||
set ("depends", combined);
|
||||
recalc_urgency = true;
|
||||
}
|
||||
else
|
||||
throw format (STRING_TASK_DEPEND_MISS_DEL, uuid);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue