| 323 | } |
| 324 | |
| 325 | void GitCache::insertCommit(CommitInfo commit) |
| 326 | { |
| 327 | QMutexLocker lock2(&mCommitsMutex); |
| 328 | |
| 329 | const auto sha = commit.sha; |
| 330 | const auto parentSha = commit.firstParent(); |
| 331 | |
| 332 | commit.setLanes({ LaneType::ACTIVE }); |
| 333 | commit.pos = 1; |
| 334 | |
| 335 | mCommitsMap[sha] = std::move(commit); |
| 336 | mCommitsMap[sha].appendChild(&mCommitsMap[CommitInfo::ZERO_SHA]); |
| 337 | |
| 338 | mCommitsMap[parentSha].removeChild(&mCommitsMap[CommitInfo::ZERO_SHA]); |
| 339 | mCommitsMap[parentSha].appendChild(&mCommitsMap[sha]); |
| 340 | |
| 341 | const auto total = mCommits.count(); |
| 342 | for (auto i = 1; i < total; ++i) |
| 343 | ++mCommits[i]->pos; |
| 344 | |
| 345 | mCommits.insert(1, &mCommitsMap[sha]); |
| 346 | } |
| 347 | |
| 348 | void GitCache::updateCommit(const QString &oldSha, CommitInfo newCommit) |
| 349 | { |
no test coverage detected