MCPcopy Create free account
hub / github.com/KDE/kdevelop / apply

Method apply

plugins/git/gitplugin.cpp:467–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467KDevelop::VcsJob * GitPlugin::apply(const KDevelop::VcsDiff& diff, const ApplyParams applyTo)
468{
469 DVcsJob* job = new GitJob(dotGitDirectory(diff.baseDiff()), this);
470 job->setType(VcsJob::Apply);
471 *job << "git" << "apply";
472 if (applyTo == Index) {
473 *job << "--index"; // Applies the diff also to the index
474 *job << "--cached"; // Does not touch the work tree
475 }
476 auto* const diffFile = new QTemporaryFile(job);
477 if (diffFile->open()) {
478 *job << diffFile->fileName();
479 diffFile->write(diff.diff().toUtf8());
480 diffFile->close();
481 } else {
482 job->cancel();
483 delete diffFile;
484 }
485 return job;
486}
487
488
489VcsJob* GitPlugin::revert(const QList<QUrl>& localLocations, IBasicVersionControl::RecursionMode recursion)

Callers 1

applySelectedMethod · 0.45

Calls 9

dotGitDirectoryFunction · 0.85
baseDiffMethod · 0.80
setTypeMethod · 0.45
openMethod · 0.45
fileNameMethod · 0.45
writeMethod · 0.45
diffMethod · 0.45
closeMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected