mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-1580: "modified" attribute not updated
- Make all local modifications update the "modified" attribute. - As per design, the user cannot overwrite this attribute; neither can hooks.
This commit is contained in:
parent
052a5c607a
commit
4f75652ccb
2 changed files with 9 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
- TW-1578 Bash tab completion problems on first run
|
||||
(thanks to Renato Alves and Ptolemarch).
|
||||
- TW-1580 "modified" attribute no longer updated (thanks to David Patrick).
|
||||
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
|
||||
amount of changes that is considered dangerous (thanks to Tomas Babej).
|
||||
|
||||
|
|
|
@ -598,7 +598,7 @@ void TDB2::update (
|
|||
const std::string& uuid,
|
||||
Task& task,
|
||||
const bool add_to_backlog,
|
||||
const bool addition)
|
||||
const bool addition /* = false */)
|
||||
{
|
||||
// Validate to add metadata.
|
||||
task.validate (false);
|
||||
|
@ -607,6 +607,13 @@ void TDB2::update (
|
|||
Task original;
|
||||
if (not addition && get (task.get ("uuid"), original))
|
||||
{
|
||||
if (add_to_backlog)
|
||||
{
|
||||
// All locally modified tasks are timestamped, implicitly overwriting any
|
||||
// changes the user or hooks tried to apply to the "modified" attribute.
|
||||
task.setAsNow ("modified");
|
||||
}
|
||||
|
||||
// Update the task, wherever it is.
|
||||
if (!pending.modify_task (task))
|
||||
completed.modify_task (task);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue