aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitclient.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2010-08-12 14:44:57 +0200
committerFriedemann Kleint <[email protected]>2010-08-12 14:44:57 +0200
commitcb3333231120c712cb1b26f13d996bd710a8572c (patch)
treebd7f50255e52c99c5e36e0ce9c89352d1d1599e3 /src/plugins/git/gitclient.cpp
parent1ae9940b325f4c6ca908790b041674921fd97b12 (diff)
VCS[git]: Add branch combo to the checkout wizard.
Provide UI with manual refresh button in BaseCheckoutWizardPage. Change ProcessCheckoutJob to be able to execute several steps. Implement in git.
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
-rw-r--r--src/plugins/git/gitclient.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index fb8393b5dd6..d2293d55668 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -1265,6 +1265,28 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory,
return StatusChanged;
}
+// Quietly retrieve branch list of remote repository URL
+QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryURL)
+{
+ QStringList arguments(QLatin1String("ls-remote"));
+ arguments << QLatin1String("--heads") << repositoryURL;
+ const unsigned flags =
+ VCSBase::VCSBasePlugin::SshPasswordPrompt|
+ VCSBase::VCSBasePlugin::SuppressStdErrInLogWindow|
+ VCSBase::VCSBasePlugin::SuppressFailMessageInLogWindow;
+ const Utils::SynchronousProcessResponse resp = synchronousGit(QString(), arguments, flags);
+ QStringList branches;
+ if (resp.result == Utils::SynchronousProcessResponse::Finished) {
+ // split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
+ foreach(const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
+ const int slashPos = line.lastIndexOf(QLatin1Char('/'));
+ if (slashPos != -1)
+ branches.push_back(line.mid(slashPos + 1));
+ }
+ }
+ return branches;
+}
+
void GitClient::launchGitK(const QString &workingDirectory)
{
VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance();