1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Desktop: remove branch name in detached head state (#4636)

This commit is contained in:
Helmut K. C. Tessarek 2021-03-11 09:39:18 -05:00 committed by GitHub
parent 6496172aed
commit 3e9cb1d4fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -27,8 +27,7 @@ module.exports = async function() {
// 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';
// The builds in CI are done from a 'detached HEAD' state, thus the branch name will be 'HEAD' for Travis builds.
} catch (err) {
// Don't display error object as it's a "fatal" error, but
// not for us, since is it not critical information

View File

@ -7,6 +7,7 @@ export default function versionInfo(packageInfo: any) {
let gitInfo = '';
if ('git' in p) {
gitInfo = _('Revision: %s (%s)', p.git.hash, p.git.branch);
if (p.git.branch === 'HEAD') gitInfo = gitInfo.slice(0, -7);
}
const copyrightText = 'Copyright © 2016-YYYY Laurent Cozic';
const now = new Date();