From a268ac71410c228d0d76cd2a9cf9a6057b1f9085 Mon Sep 17 00:00:00 2001 From: Philipp David Date: Tue, 15 Mar 2022 09:04:43 +0100 Subject: [PATCH] Add GITDIR-NOTFOUND check This adds a check for a GIT_REFSPEC value of "GITDIR-NOTFOUND" and sets the VERSION_CHANNEL to stable in that case. Without this change, "GITDIR-N" is appended to the version string when building from a source archive instead of a git checkout. --- buildconfig/BuildConfig.cpp.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 6524fb5d..4625b1bf 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -28,7 +28,11 @@ Config::Config() GIT_COMMIT = "@Launcher_GIT_COMMIT@"; GIT_REFSPEC = "@Launcher_GIT_REFSPEC@"; - if(GIT_REFSPEC.startsWith("refs/heads/")) + if (GIT_REFSPEC == QStringLiteral("GITDIR-NOTFOUND")) + { + VERSION_CHANNEL = QStringLiteral("stable"); + } + else if(GIT_REFSPEC.startsWith("refs/heads/")) { VERSION_CHANNEL = GIT_REFSPEC; VERSION_CHANNEL.remove("refs/heads/");