| 184 | } |
| 185 | |
| 186 | static void addNumStat(QList<GitUtils::StatusItem> &items, int add, int sub, std::string_view file) |
| 187 | { |
| 188 | // look in modified first, then staged |
| 189 | auto item = std::find_if(items.begin(), items.end(), [file](const GitUtils::StatusItem &si) { |
| 190 | return file.compare(0, si.file.size(), si.file.data()) == 0; |
| 191 | }); |
| 192 | if (item != items.end()) { |
| 193 | item->linesAdded = add; |
| 194 | item->linesRemoved = sub; |
| 195 | return; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | static std::optional<int> toInt(std::string_view s) |
| 200 | { |
no test coverage detected