forked from qt-creator/qt-creator
Git: Fix detection for 2-digit versions
1.7.10 is currently detected as 1.7.1 Change-Id: Iaba8ba3e1f6ba880ae088811ccfd133fd7f70e14 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Eike Ziller
parent
29a2413d42
commit
7b2ef0a3b3
@@ -2383,12 +2383,12 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
|
||||
}
|
||||
// cut 'git version 1.6.5.1.sha'
|
||||
const QString output = commandOutputFromLocal8Bit(outputText);
|
||||
QRegExp versionPattern(QLatin1String("^[^\\d]+([\\d])\\.([\\d])\\.([\\d]).*$"));
|
||||
QRegExp versionPattern(QLatin1String("^[^\\d]+(\\d+)\\.(\\d+)\\.(\\d+).*$"));
|
||||
QTC_ASSERT(versionPattern.isValid(), return 0);
|
||||
QTC_ASSERT(versionPattern.exactMatch(output), return 0);
|
||||
const unsigned major = versionPattern.cap(1).toUInt();
|
||||
const unsigned minor = versionPattern.cap(2).toUInt();
|
||||
const unsigned patch = versionPattern.cap(3).toUInt();
|
||||
const unsigned major = versionPattern.cap(1).toUInt(0, 16);
|
||||
const unsigned minor = versionPattern.cap(2).toUInt(0, 16);
|
||||
const unsigned patch = versionPattern.cap(3).toUInt(0, 16);
|
||||
return version(major, minor, patch);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user