Commit 43e76f09 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Sort branches by commiterdate

parent 0441b0c8
......@@ -45,6 +45,9 @@ public:
bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override
if (m_pattern.isEmpty()) {
return QSortFilterProxyModel::lessThan(sourceLeft, sourceRight);
const int l =;
const int r =;
return l < r;
......@@ -41,7 +41,7 @@ QVector<GitUtils::Branch> GitUtils::getAllBranchesAndTags(const QString &repo, R
// git for-each-ref --format '%(refname) %(objectname) %(*objectname)'
QProcess git;
QStringList args{QStringLiteral("for-each-ref"), QStringLiteral("--format"), QStringLiteral("%(refname)")};
QStringList args{QStringLiteral("for-each-ref"), QStringLiteral("--format"), QStringLiteral("%(refname)"), QStringLiteral("--sort=-committerdate")};
git.start(QStringLiteral("git"), args);
QVector<Branch> branches;
Supports Markdown
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