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

Method commitStaged

plugins/git/gitplugin.cpp:545–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545KDevelop::VcsJob * GitPlugin::commitStaged(const QString& message, const QUrl& repoUrl)
546{
547 if (message.isEmpty())
548 return makeVcsErrorJob(i18n("No message specified"), this);
549 const QDir dir = dotGitDirectory(repoUrl);
550 if (!ensureValidGitIdentity(dir)) {
551 return makeVcsErrorJob(i18n("Email or name for Git not specified"), this);
552 }
553 auto* job = new GitJob(dir, this);
554 job->setType(VcsJob::Commit);
555 *job << "git" << "commit" << "-m" << message;
556 return job;
557}
558
559
560bool GitPlugin::ensureValidGitIdentity(const QDir& dir)

Callers 1

commitActiveProjectMethod · 0.80

Calls 3

dotGitDirectoryFunction · 0.85
isEmptyMethod · 0.45
setTypeMethod · 0.45

Tested by

no test coverage detected