mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdStart: Do not silently fail if tags match
It was possible previously to start an interval with a filter earlier than the current filter, and if the tags matched, the command would report success without actually moving the start time. Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This commit is contained in:
parent
356f20c9de
commit
6a52a412ba
2 changed files with 11 additions and 1 deletions
|
@ -48,12 +48,17 @@ int CmdStart (
|
|||
|
||||
journal.startTransaction ();
|
||||
|
||||
if (!filter.is_started ())
|
||||
{
|
||||
filter.start = now;
|
||||
}
|
||||
|
||||
// If the latest interval is open, close it.
|
||||
if (latest.is_open ())
|
||||
{
|
||||
// If the new interval tags match those of the currently open interval, then
|
||||
// do nothing - the tags are already being tracked.
|
||||
if (latest.tags () == filter.tags ())
|
||||
if (latest.encloses (filter) && latest.tags () == filter.tags ())
|
||||
{
|
||||
if (verbose)
|
||||
std::cout << intervalSummarize (database, rules, latest);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue