mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
context: Do not interpret empty filter/mods as missing context definition
This is a corner case bug, when user has both old-style and new-style context defined, where new-style is defined as empty string, the old-style will (incorrectly) take precedence. Closes #2629.
This commit is contained in:
parent
887b04f7f4
commit
1d4baca0d9
1 changed files with 5 additions and 2 deletions
|
@ -966,8 +966,9 @@ std::string Context::getTaskContext (const std::string& kind, std::string name,
|
|||
}
|
||||
|
||||
// Figure out the context string for this kind (read/write)
|
||||
std::string contextString = config.get ("context." + name + "." + kind);
|
||||
if (contextString.empty ())
|
||||
std::string contextString;
|
||||
|
||||
if (! config.has ("context." + name + "." + kind))
|
||||
{
|
||||
debug ("Specific " + kind + " context for '" + name + "' not defined. ");
|
||||
if (fallback)
|
||||
|
@ -976,6 +977,8 @@ std::string Context::getTaskContext (const std::string& kind, std::string name,
|
|||
contextString = config.get ("context." + name);
|
||||
}
|
||||
}
|
||||
else
|
||||
contextString = config.get ("context." + name + "." + kind);
|
||||
|
||||
debug (format ("Detected context string: {1}", contextString.empty() ? "(empty)" : contextString));
|
||||
return contextString;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue