More robust isolation of the git commit hash, without special cases

This commit is contained in:
baldurk
2017-03-10 13:27:59 +00:00
parent 248dbfa4a2
commit c89bcfbb7a
+6 -1
View File
@@ -63,7 +63,12 @@ struct Version
static QString string() { return "v" RENDERDOC_VERSION_STRING; }
static QString gitCommitHash()
{
return QString(GIT_COMMIT_HASH).replace("-official", "").replace("-beta", "");
QString hash(GIT_COMMIT_HASH);
int dash = hash.indexOf(QChar('-'));
if(dash < 0)
return hash;
else
return hash.left(dash);
}
static bool isMismatched() { return RENDERDOC_GetVersionString() != bareString(); }