mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
* Add test case to cover https://github.com/GothenburgBitFactory/taskwarrior/issues/3416 * Add (builtin) on-add-modify test hook and use it * TDB2::add() move hook invocation before save (#3416)
This commit is contained in:
parent
e4c33d1e1d
commit
fb16dbf7cf
3 changed files with 41 additions and 3 deletions
|
@ -81,6 +81,9 @@ void TDB2::add (Task& task)
|
|||
std::string uuid = task.get ("uuid");
|
||||
changes[uuid] = task;
|
||||
|
||||
// run hooks for this new task
|
||||
Context::getContext ().hooks.onAdd (task);
|
||||
|
||||
auto innertask = replica.import_task_with_uuid (uuid);
|
||||
|
||||
{
|
||||
|
@ -121,9 +124,6 @@ void TDB2::add (Task& task)
|
|||
// update the cached working set with the new information
|
||||
_working_set = std::make_optional (std::move (ws));
|
||||
|
||||
// run hooks for this new task
|
||||
Context::getContext ().hooks.onAdd (task);
|
||||
|
||||
if (id.has_value ()) {
|
||||
task.id = id.value();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue