forked from qt-creator/qt-creator
Git: Fix upstream status for branches with slash
Like wip/foo Change-Id: Ia2816660f7878e872b2e49c4811f5893a1b8dc75 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
cad625c739
commit
af455fa40c
@@ -150,6 +150,11 @@ public:
|
|||||||
return fn;
|
return fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString fullRef(bool includePrefix = false) const
|
||||||
|
{
|
||||||
|
return fullName(includePrefix).join('/');
|
||||||
|
}
|
||||||
|
|
||||||
void insert(const QStringList &path, BranchNode *n)
|
void insert(const QStringList &path, BranchNode *n)
|
||||||
{
|
{
|
||||||
BranchNode *current = this;
|
BranchNode *current = this;
|
||||||
@@ -186,7 +191,7 @@ public:
|
|||||||
}
|
}
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
return {fullName().join('/')};
|
return {fullRef()};
|
||||||
}
|
}
|
||||||
|
|
||||||
int rowOf(BranchNode *node)
|
int rowOf(BranchNode *node)
|
||||||
@@ -346,7 +351,7 @@ QVariant BranchModel::data(const QModelIndex &index, int role) const
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
case Qt::EditRole:
|
case Qt::EditRole:
|
||||||
return index.column() == 0 ? node->fullName().join('/') : QVariant();
|
return index.column() == 0 ? node->fullRef() : QVariant();
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
if (!node->isLeaf())
|
if (!node->isLeaf())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
@@ -381,7 +386,7 @@ bool BranchModel::setData(const QModelIndex &index, const QVariant &value, int r
|
|||||||
if (newName.isEmpty())
|
if (newName.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const QString oldName = node->fullName().join('/');
|
const QString oldName = node->fullRef();
|
||||||
if (oldName == newName)
|
if (oldName == newName)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -525,7 +530,7 @@ QString BranchModel::fullName(const QModelIndex &idx, bool includePrefix) const
|
|||||||
return QString();
|
return QString();
|
||||||
if (node == d->headNode)
|
if (node == d->headNode)
|
||||||
return QString("HEAD");
|
return QString("HEAD");
|
||||||
return node->fullName(includePrefix).join('/');
|
return node->fullRef(includePrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList BranchModel::localBranchNames() const
|
QStringList BranchModel::localBranchNames() const
|
||||||
@@ -901,7 +906,8 @@ void BranchModel::updateUpstreamStatus(BranchNode *node)
|
|||||||
{
|
{
|
||||||
if (node->tracking.isEmpty())
|
if (node->tracking.isEmpty())
|
||||||
return;
|
return;
|
||||||
VcsCommand *command = d->client->asyncUpstreamStatus(d->workingDirectory, node->name, node->tracking);
|
VcsCommand *command = d->client->asyncUpstreamStatus(
|
||||||
|
d->workingDirectory, node->fullRef(), node->tracking);
|
||||||
QObject::connect(command, &VcsCommand::stdOutText, node, [this, node](const QString &text) {
|
QObject::connect(command, &VcsCommand::stdOutText, node, [this, node](const QString &text) {
|
||||||
const QStringList split = text.trimmed().split('\t');
|
const QStringList split = text.trimmed().split('\t');
|
||||||
QTC_ASSERT(split.size() == 2, return);
|
QTC_ASSERT(split.size() == 2, return);
|
||||||
|
Reference in New Issue
Block a user