Hide error outputs from checking for git root (#157851)

## Summary
Addresses #157341 

The error comes because STDERR by default is piped to the parent
process's stderr.
- Quench error output of git rev-parse

### Checklist

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Alex Szabo 2023-05-22 09:45:45 +02:00 committed by GitHub
parent 363f2b5e6a
commit 8a081dc308
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];