mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-16 14:14:30 +00:00
Ignore stderr when calling git executable
This hopefully prevents confusing error messages in the docker image. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
3c8a20e35c
commit
f544b15eea
1 changed files with 4 additions and 1 deletions
|
@ -27,7 +27,10 @@ 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').replace('\n', '')
|
||||
return require('child_process').execSync('git rev-parse HEAD', {
|
||||
stdio: ['pipe', 'pipe', 'ignore'],
|
||||
encoding: 'utf-8'
|
||||
}).replace('\n', '')
|
||||
} catch (e) {
|
||||
// there was an error running git, try to parse refs ourselves
|
||||
if (!fs.existsSync(repodir + '/.git/HEAD')) {
|
||||
|
|
Loading…
Reference in a new issue