1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

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.
This commit is contained in:
Helmut K. C. Tessarek
2020-02-07 20:02:10 -05:00
committed by GitHub
parent df63572b7c
commit cfb59f2f19

View File

@@ -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