mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Confirmation
- Modified the 'modify' command so that it only applies changes if the requested changes made a difference. For example if the command task 1 mod pri:H was followed by: task 1 mod pri:H then the second command will report 'task not changed'.
This commit is contained in:
parent
3786e6cff3
commit
aaa8c5e950
1 changed files with 58 additions and 56 deletions
|
@ -72,7 +72,8 @@ int CmdModify::execute (std::string& output)
|
||||||
{
|
{
|
||||||
Task before (*task);
|
Task before (*task);
|
||||||
modify_task_description_replace (*task, modifications);
|
modify_task_description_replace (*task, modifications);
|
||||||
|
if (taskDiff (before, *task))
|
||||||
|
{
|
||||||
// Perform some logical consistency checks.
|
// Perform some logical consistency checks.
|
||||||
if (task->has ("recur") &&
|
if (task->has ("recur") &&
|
||||||
!task->has ("due") &&
|
!task->has ("due") &&
|
||||||
|
@ -138,6 +139,7 @@ int CmdModify::execute (std::string& output)
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
context.tdb2.commit ();
|
context.tdb2.commit ();
|
||||||
feedback_affected (count == 1 ? STRING_CMD_MODIFY_1 : STRING_CMD_MODIFY_N, count);
|
feedback_affected (count == 1 ? STRING_CMD_MODIFY_1 : STRING_CMD_MODIFY_N, count);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue