diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp
index 55305addd8c..0955b12bc1b 100644
--- a/src/plugins/git/branchdialog.cpp
+++ b/src/plugins/git/branchdialog.cpp
@@ -69,6 +69,7 @@ BranchDialog::BranchDialog(QWidget *parent) :
connect(m_ui->logButton, SIGNAL(clicked()), this, SLOT(log()));
connect(m_ui->mergeButton, SIGNAL(clicked()), this, SLOT(merge()));
connect(m_ui->rebaseButton, SIGNAL(clicked()), this, SLOT(rebase()));
+ connect(m_ui->cherryPickButton, SIGNAL(clicked()), this, SLOT(cherryPick()));
connect(m_ui->trackButton, SIGNAL(clicked()), this, SLOT(setRemoteTracking()));
m_ui->branchView->setModel(m_model);
@@ -123,6 +124,7 @@ void BranchDialog::enableButtons()
m_ui->checkoutButton->setEnabled(hasActions && !currentSelected);
m_ui->rebaseButton->setEnabled(hasActions && !currentSelected);
m_ui->mergeButton->setEnabled(hasActions && !currentSelected);
+ m_ui->cherryPickButton->setEnabled(hasActions && !currentSelected);
m_ui->trackButton->setEnabled(hasActions && currentLocal && !currentSelected && !isTag);
}
@@ -338,6 +340,15 @@ void BranchDialog::rebase()
client->rebase(m_repository, baseBranch);
}
+void BranchDialog::cherryPick()
+{
+ QModelIndex idx = selectedIndex();
+ QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
+
+ const QString branch = m_model->fullName(idx, true);
+ GitPlugin::instance()->gitClient()->synchronousCherryPick(m_repository, branch);
+}
+
void BranchDialog::setRemoteTracking()
{
m_model->setRemoteTracking(selectedIndex());
diff --git a/src/plugins/git/branchdialog.h b/src/plugins/git/branchdialog.h
index 12d19e5e4e6..3343becfa97 100644
--- a/src/plugins/git/branchdialog.h
+++ b/src/plugins/git/branchdialog.h
@@ -74,6 +74,7 @@ private slots:
void log();
void merge();
void rebase();
+ void cherryPick();
void setRemoteTracking();
private:
diff --git a/src/plugins/git/branchdialog.ui b/src/plugins/git/branchdialog.ui
index c57bba79065..11adc4cb4aa 100644
--- a/src/plugins/git/branchdialog.ui
+++ b/src/plugins/git/branchdialog.ui
@@ -153,6 +153,16 @@
+ -
+
+
+ Cherry Pick top commit from selected branch
+
+
+ Cherry Pick
+
+
+
-