Git: Refix filtering of obsolete branches when adding a branch

It was fixed in 62c60c6d1c but broke again
by 04eb012267.

Task-number: QTCREATORBUG-16264
Change-Id: I1130d5c2eda3320714913570441499be0d55c8fe
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2016-07-15 15:27:55 +03:00
committed by Orgad Shaneh
parent 1e7bf7f721
commit c125fbbe97

View File

@@ -691,9 +691,13 @@ void BranchModel::parseOutputLine(const QString &line)
}
if (!m_oldBranchesIncluded && !current && dateTime.isValid()) {
const int age = dateTime.daysTo(QDateTime::currentDateTime());
if (age > Constants::OBSOLETE_COMMIT_AGE_IN_DAYS)
const qint64 age = dateTime.daysTo(QDateTime::currentDateTime());
if (age > Constants::OBSOLETE_COMMIT_AGE_IN_DAYS) {
const QString heads = "refs/heads/";
if (fullName.startsWith(heads))
m_obsoleteLocalBranches.append(fullName.mid(heads.size()));
return;
}
}
bool showTags = m_client->settings().boolValue(GitSettings::showTagsKey);