mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
context: Interpret legacy-style context as read context only
This provides a better migration path than surprising users with the write context functionality out of the blue. Closes #2620.
This commit is contained in:
parent
1d4baca0d9
commit
d5a026d91a
1 changed files with 3 additions and 3 deletions
|
@ -966,14 +966,14 @@ std::string Context::getTaskContext (const std::string& kind, std::string name,
|
|||
}
|
||||
|
||||
// Figure out the context string for this kind (read/write)
|
||||
std::string contextString;
|
||||
std::string contextString = "";
|
||||
|
||||
if (! config.has ("context." + name + "." + kind))
|
||||
if (! config.has ("context." + name + "." + kind) && kind == "read")
|
||||
{
|
||||
debug ("Specific " + kind + " context for '" + name + "' not defined. ");
|
||||
if (fallback)
|
||||
{
|
||||
debug ("Falling back on generic.");
|
||||
debug ("Trying to interpret old-style context definition as read context.");
|
||||
contextString = config.get ("context." + name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue