From 8b69ac1bcfd74fd8ecfd1907b6e1d8a23f3b8400 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 15 Aug 2021 00:16:46 +0200 Subject: [PATCH] Fix unescaped line break in `git` output Signed-off-by: David Mehren --- lib/config/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config/utils.js b/lib/config/utils.js index 39be6c2ae..c42bbd89f 100644 --- a/lib/config/utils.js +++ b/lib/config/utils.js @@ -27,7 +27,7 @@ exports.toIntegerConfig = function toIntegerConfig (configValue) { exports.getGitCommit = function getGitCommit (repodir) { try { // prefer using git to get the current ref, as poking in .git is very fragile - return require('child_process').execSync('git rev-parse HEAD') + return require('child_process').execSync('git rev-parse HEAD').replace('\n', '') } catch (e) { // there was an error running git, try to parse refs ourselves if (!fs.existsSync(repodir + '/.git/HEAD')) {