MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / insertCommit

Method insertCommit

3rdparty/unioncode-GitQlient/src/cache/GitCache.cpp:325–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325void 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
348void GitCache::updateCommit(const QString &oldSha, CommitInfo newCommit)
349{

Callers 3

cherryPickCommitMethod · 0.80
commitChangesMethod · 0.80
cherryPickCommitMethod · 0.80

Calls 6

firstParentMethod · 0.80
removeChildMethod · 0.80
insertMethod · 0.80
setLanesMethod · 0.45
appendChildMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected