Commit 51019389 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Git: Remove branches from show header

It is too slow on large repositories. Will be revived in 3.2 with a
trigger button.

Task-number: QTCREATORBUG-11293
Change-Id: I6ba2028b280821b2acb49b7664ec9ece063c8981
Reviewed-by: default avatarPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent b67157fb
...@@ -2861,21 +2861,6 @@ QString GitClient::extendedShowDescription(const QString &workingDirectory, cons ...@@ -2861,21 +2861,6 @@ QString GitClient::extendedShowDescription(const QString &workingDirectory, cons
modText.insert(lastHeaderLine, QLatin1String("Precedes: ") + precedes + QLatin1Char('\n')); modText.insert(lastHeaderLine, QLatin1String("Precedes: ") + precedes + QLatin1Char('\n'));
if (!follows.isEmpty()) if (!follows.isEmpty())
modText.insert(lastHeaderLine, QLatin1String("Follows: ") + follows + QLatin1Char('\n')); modText.insert(lastHeaderLine, QLatin1String("Follows: ") + follows + QLatin1Char('\n'));
QString moreBranches;
QStringList branches = synchronousBranchesForCommit(workingDirectory, commit);
const int branchCount = branches.count();
// If there are more than 20 branches, list first 10 followed by a hint
if (branchCount > 20) {
const int leave = 10;
//: Displayed after the untranslated message "Branches: branch1, branch2 'and %n more'" in git show.
moreBranches = QLatin1Char(' ') + tr("and %n more", 0, branchCount - leave);
branches.erase(branches.begin() + leave, branches.end());
}
if (!branches.isEmpty()) {
modText.insert(lastHeaderLine, QLatin1String("Branches: ")
+ branches.join(QLatin1String(", ")) + moreBranches
+ QLatin1Char('\n'));
}
return modText; return modText;
} }
......
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