Git: Set remote-tracking branch

Task-number: QTCREATORBUG-8863
Change-Id: I06df735d85e2f9ed17c71385fed5057f8fc67d55
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-07-02 22:57:58 +03:00
committed by Orgad Shaneh
parent 51a9d5065a
commit 062b8f5d31
7 changed files with 57 additions and 1 deletions

View File

@@ -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)