mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-05 14:07:21 +02:00
Dependencies
- Fixed bug in Task::addDependency where a 'dup dep' error string was not properly composed, which cause the error message to be shown as 'k'. - Relocated expression evaluation on modification to only be processed for date attributes. This impacts DOM, but fixes more than it breaks. - Corrected unit test that was expecting an old-style error message. - Added protection against array overrun in next_mod_group. Again.
This commit is contained in:
parent
d1e52c05d6
commit
776bfea402
3 changed files with 21 additions and 18 deletions
|
@ -711,19 +711,20 @@ void Task::addDependency (int id)
|
|||
if (id == this->id)
|
||||
throw std::string (STRING_TASK_DEPEND_ITSELF);
|
||||
|
||||
// Check for extant dependency.
|
||||
// Check that id is resolvable.
|
||||
std::string uuid = context.tdb2.pending.uuid (id);
|
||||
if (uuid == "")
|
||||
throw format (STRING_TASK_DEPEND_MISSING, id);
|
||||
|
||||
// Store the dependency.
|
||||
std::string depends = get ("depends");
|
||||
if (depends.length ())
|
||||
if (depends != "")
|
||||
{
|
||||
// Check for extant dependency.
|
||||
if (depends.find (uuid) == std::string::npos)
|
||||
set ("depends", depends + "," + uuid);
|
||||
else
|
||||
throw std::string (STRING_TASK_DEPEND_DUP, this->id, id);
|
||||
throw format (STRING_TASK_DEPEND_DUP, this->id, id);
|
||||
}
|
||||
else
|
||||
set ("depends", uuid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue