summaryrefslogtreecommitdiff
path: root/src/plugins/git/branchmodel.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-07-02 22:57:58 +0300
committerOrgad Shaneh <orgads@gmail.com>2013-07-10 12:50:50 +0200
commit062b8f5d31343fb2dbc8d27c14eb9f0ae807a6da (patch)
tree3845d25a04d1010b6d947f543f23c4a18144f9fb /src/plugins/git/branchmodel.cpp
parent51a9d5065a9c1243ef942bc71220413eaa4e785b (diff)
downloadqt-creator-062b8f5d31343fb2dbc8d27c14eb9f0ae807a6da.tar.gz
Git: Set remote-tracking branch
Task-number: QTCREATORBUG-8863 Change-Id: I06df735d85e2f9ed17c71385fed5057f8fc67d55 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/branchmodel.cpp')
-rw-r--r--src/plugins/git/branchmodel.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp
index 1a07e15692..a7b4ca0371 100644
--- a/src/plugins/git/branchmodel.cpp
+++ b/src/plugins/git/branchmodel.cpp
@@ -623,6 +623,18 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel
return nodeToIndex(newNode);
}
+void BranchModel::setRemoteTracking(const QModelIndex &trackingIndex)
+{
+ QModelIndex current = currentBranch();
+ QTC_ASSERT(current.isValid(), return);
+ const QString currentName = fullName(current);
+ const QString shortTracking = fullName(trackingIndex);
+ const QString tracking = fullName(trackingIndex, true);
+ m_client->synchronousSetTrackingBranch(m_workingDirectory, currentName, tracking);
+ m_currentBranch->tracking = shortTracking;
+ emit dataChanged(current, current);
+}
+
void BranchModel::parseOutputLine(const QString &line)
{
if (line.size() < 3)