forked from qt-creator/qt-creator
Git: Document line output in branch model
Change-Id: I723df048844cf9a803aa0c438cddf8fdcdd407ba Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
bcc1786fa2
commit
6d08c1f914
@@ -634,10 +634,12 @@ void BranchModel::parseOutputLine(const QString &line)
|
|||||||
if (line.size() < 3)
|
if (line.size() < 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// objectname, refname, upstream:short, *objectname
|
||||||
QStringList lineParts = line.split(QLatin1Char('\t'));
|
QStringList lineParts = line.split(QLatin1Char('\t'));
|
||||||
const QString shaDeref = lineParts.at(3);
|
const QString shaDeref = lineParts.at(3);
|
||||||
const QString sha = shaDeref.isEmpty() ? lineParts.at(0) : shaDeref;
|
const QString sha = shaDeref.isEmpty() ? lineParts.at(0) : shaDeref;
|
||||||
const QString fullName = lineParts.at(1);
|
const QString fullName = lineParts.at(1);
|
||||||
|
const QString upstream = lineParts.at(2);
|
||||||
|
|
||||||
bool current = (sha == m_currentSha);
|
bool current = (sha == m_currentSha);
|
||||||
bool showTags = m_client->settings().boolValue(GitSettings::showTagsKey);
|
bool showTags = m_client->settings().boolValue(GitSettings::showTagsKey);
|
||||||
@@ -671,7 +673,7 @@ void BranchModel::parseOutputLine(const QString &line)
|
|||||||
const QString name = nameParts.last();
|
const QString name = nameParts.last();
|
||||||
nameParts.removeLast();
|
nameParts.removeLast();
|
||||||
|
|
||||||
auto newNode = new BranchNode(name, sha, lineParts.at(2));
|
auto newNode = new BranchNode(name, sha, upstream);
|
||||||
root->insert(nameParts, newNode);
|
root->insert(nameParts, newNode);
|
||||||
if (current)
|
if (current)
|
||||||
m_currentBranch = newNode;
|
m_currentBranch = newNode;
|
||||||
|
|||||||
Reference in New Issue
Block a user