MCPcopy Create free account
hub / github.com/KDE/kate / getRemoteForCurrentBranch

Function getRemoteForCurrentBranch

addons/project/pushpulldialog.cpp:136–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136static QString getRemoteForCurrentBranch(const QString &repo, const QString &branch)
137{
138 QProcess git;
139 const QStringList args{QStringLiteral("config"), QStringLiteral("branch.%1.remote").arg(branch)};
140 if (!setupGitProcess(git, repo, args)) {
141 return {};
142 }
143
144 startHostProcess(git, QIODevice::ReadOnly);
145 if (git.waitForStarted() && git.waitForFinished(-1)) {
146 if (git.exitStatus() == QProcess::NormalExit && git.exitCode() == 0) {
147 return QString::fromUtf8(git.readAllStandardOutput().trimmed());
148 }
149 }
150 return {};
151}
152
153QStringList PushPullDialog::buildCmdStrings(Mode m)
154{

Callers 1

buildCmdStringsMethod · 0.85

Calls 3

setupGitProcessFunction · 0.85
startHostProcessFunction · 0.85
waitForFinishedMethod · 0.80

Tested by

no test coverage detected