Git: Filter out tags on command execution

For a repo with ~50K tags, this reduces the time of for-each-ref from
~1s to ~270ms.

Change-Id: I00f735bba62307cc9419619ebe5aa71a800368ea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2023-02-12 14:40:16 +02:00
committed by Orgad Shaneh
parent cd8ea1f45b
commit 8cd11e93e0

View File

@@ -409,8 +409,12 @@ bool BranchModel::refresh(const FilePath &workingDirectory, QString *errorMessag
}
d->currentSha = d->client->synchronousTopRevision(workingDirectory, &d->currentDateTime);
const QStringList args = {"--format=%(objectname)\t%(refname)\t%(upstream:short)\t"
"%(*objectname)\t%(committerdate:raw)\t%(*committerdate:raw)"};
QStringList args = {"--format=%(objectname)\t%(refname)\t%(upstream:short)\t"
"%(*objectname)\t%(committerdate:raw)\t%(*committerdate:raw)",
"refs/heads/**",
"refs/remotes/**"};
if (d->client->settings().showTags.value())
args << "refs/tags/**";
QString output;
if (!d->client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage)) {
endResetModel();