mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Remove duplicate check from task diag (#3545)
This commit is contained in:
parent
6d3519419e
commit
847c482c25
3 changed files with 1 additions and 79 deletions
|
@ -300,35 +300,8 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
<< Context::getContext ().getHeight ()
|
||||
<< '\n';
|
||||
|
||||
// Scan tasks for duplicate UUIDs.
|
||||
auto all = Context::getContext ().tdb2.all_tasks ();
|
||||
std::map <std::string, int> seen;
|
||||
std::vector <std::string> dups;
|
||||
std::string uuid;
|
||||
for (auto& i : all)
|
||||
{
|
||||
uuid = i.get ("uuid");
|
||||
if (seen.find (uuid) != seen.end ())
|
||||
dups.push_back (uuid);
|
||||
else
|
||||
seen[uuid] = 0;
|
||||
}
|
||||
|
||||
out << " Dups: "
|
||||
<< format ("Scanned {1} tasks for duplicate UUIDs:", all.size ())
|
||||
<< '\n';
|
||||
|
||||
if (dups.size ())
|
||||
{
|
||||
for (auto& d : dups)
|
||||
out << " " << format ("Found duplicate {1}", d) << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
out << " No duplicates found\n";
|
||||
}
|
||||
|
||||
// Check all the UUID references
|
||||
auto all = Context::getContext ().tdb2.all_tasks ();
|
||||
|
||||
bool noBrokenRefs = true;
|
||||
out << " Broken ref: "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue