Commit 0d187323 authored by Robert Loehning's avatar Robert Loehning
Browse files

VCS[git]: Do not show pseudo branch "(no branch)"

parent ce24dfa3
...@@ -40,8 +40,7 @@ enum { debug = 0 }; ...@@ -40,8 +40,7 @@ enum { debug = 0 };
namespace Git { namespace Git {
namespace Internal { namespace Internal {
// Parse a branch line: " *name sha description". Return true if it is // Parse a branch line: " *name sha description".
// the current one
bool RemoteBranchModel::Branch::parse(const QString &lineIn, bool *isCurrent) bool RemoteBranchModel::Branch::parse(const QString &lineIn, bool *isCurrent)
{ {
if (debug) if (debug)
...@@ -53,12 +52,10 @@ bool RemoteBranchModel::Branch::parse(const QString &lineIn, bool *isCurrent) ...@@ -53,12 +52,10 @@ bool RemoteBranchModel::Branch::parse(const QString &lineIn, bool *isCurrent)
const QString branchInfo = lineIn.mid(2); const QString branchInfo = lineIn.mid(2);
QStringList tokens; QStringList tokens;
if (*isCurrent && branchInfo.startsWith(QLatin1String("(no branch)"))) { if (*isCurrent && branchInfo.startsWith(QLatin1String("(no branch)")))
tokens += tr("(no branch)"); return false;
tokens += branchInfo.mid(11).split(QLatin1Char(' '), QString::SkipEmptyParts); else
} else {
tokens = branchInfo.split(QLatin1Char(' '), QString::SkipEmptyParts); tokens = branchInfo.split(QLatin1Char(' '), QString::SkipEmptyParts);
}
if (tokens.size() < 2) if (tokens.size() < 2)
return false; return false;
name = tokens.at(0); name = tokens.at(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment