[8.8] Hide error outputs from checking for git root (#157851) (#158161)

# Backport

This will backport the following commits from `main` to `8.8`:
- [Hide error outputs from checking for git root
(#157851)](https://github.com/elastic/kibana/pull/157851)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"alex.szabo@elastic.co"},"sourceCommit":{"committedDate":"2023-05-22T07:45:45Z","message":"Hide
error outputs from checking for git root (#157851)\n\n##
Summary\r\nAddresses #157341 \r\n\r\nThe error comes because STDERR by
default is piped to the parent\r\nprocess's stderr.\r\n- Quench error
output of git rev-parse\r\n\r\n### Checklist\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8a081dc30857cc778646f541119bceee0c23064b","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","v8.8.0","v8.9.0"],"number":157851,"url":"https://github.com/elastic/kibana/pull/157851","mergeCommit":{"message":"Hide
error outputs from checking for git root (#157851)\n\n##
Summary\r\nAddresses #157341 \r\n\r\nThe error comes because STDERR by
default is piped to the parent\r\nprocess's stderr.\r\n- Quench error
output of git rev-parse\r\n\r\n### Checklist\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8a081dc30857cc778646f541119bceee0c23064b"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157851","number":157851,"mergeCommit":{"message":"Hide
error outputs from checking for git root (#157851)\n\n##
Summary\r\nAddresses #157341 \r\n\r\nThe error comes because STDERR by
default is piped to the parent\r\nprocess's stderr.\r\n- Quench error
output of git rev-parse\r\n\r\n### Checklist\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8a081dc30857cc778646f541119bceee0c23064b"}}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
This commit is contained in:
Kibana Machine 2023-05-22 05:02:30 -04:00 committed by GitHub
parent 1f033b4cad
commit acba2cd62c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,7 @@ function getGitRepoRootSync(repoRoot) {
cwd: repoRoot,
encoding: 'utf8',
maxBuffer: Infinity,
stdio: 'pipe',
});
const firstLine = stdout.split('\n')[0];