From cfb59f2f19906749f77d98f47b4218209ac3cb2c Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Fri, 7 Feb 2020 20:02:10 -0500 Subject: [PATCH] Desktop: show master instead of HEAD as branch in about box (#2465) Builds in CI are done from a 'detached HEAD' state. Thus `git rev-parse --abbrev-ref HEAD` always returns HEAD, which is not master. Releases are always created from the master branch, thus HEAD -> master. --- ElectronClient/app/compile-package-info.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ElectronClient/app/compile-package-info.js b/ElectronClient/app/compile-package-info.js index 8b0fc8aebc..528844e678 100644 --- a/ElectronClient/app/compile-package-info.js +++ b/ElectronClient/app/compile-package-info.js @@ -23,6 +23,8 @@ try { // Use stdio: 'pipe' so that execSync doesn't print error directly to stdout branch = execSync('git rev-parse --abbrev-ref HEAD', { stdio: 'pipe' }).toString().trim(); hash = execSync('git log --pretty="%h" -1', { stdio: 'pipe' }).toString().trim(); + // The builds in CI are done from a 'detached HEAD' state + if (branch === 'HEAD') branch = 'master'; } catch (err) { // Don't display error object as it's a "fatal" error, but // not for us, since is it not critical information