Add --no-show-signature to "git show" commands (#23038)

* Add --no-show-signature to "git show" commands.

This fixes errors if the user has configured the following in their ~/.gitconfig:
[log]
showSignature = true

* yarn prettier-all
This commit is contained in:
Stefan Sundin
2022-01-11 12:14:08 -05:00
committed by GitHub
parent a61e21eefe
commit 6ad6144838
3 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ const GITHUB_URL = 'https://github.com/facebook/react';
function getGitCommit() {
try {
return execSync('git show -s --format=%h')
return execSync('git show -s --no-show-signature --format=%h')
.toString()
.trim();
} catch (error) {
+4 -2
View File
@@ -72,7 +72,9 @@ const getBuildInfo = async () => {
const branch = await execRead('git branch | grep \\* | cut -d " " -f2', {
cwd,
});
const commit = await execRead('git show -s --format=%h', {cwd});
const commit = await execRead('git show -s --no-show-signature --format=%h', {
cwd,
});
const checksum = await getChecksumForCurrentRevision(cwd);
const dateString = await getDateStringForCommit(commit);
const version = isExperimental
@@ -106,7 +108,7 @@ const getChecksumForCurrentRevision = async cwd => {
const getDateStringForCommit = async commit => {
let dateString = await execRead(
`git show -s --format=%cd --date=format:%Y%m%d ${commit}`
`git show -s --no-show-signature --format=%cd --date=format:%Y%m%d ${commit}`
);
// On CI environment, this string is wrapped with quotes '...'s
+9 -3
View File
@@ -19,12 +19,18 @@ const {
// by configuring an environment variable.
const sha = String(
spawnSync('git', ['show', '-s', '--format=%h']).stdout
spawnSync('git', ['show', '-s', '--no-show-signature', '--format=%h']).stdout
).trim();
let dateString = String(
spawnSync('git', ['show', '-s', '--format=%cd', '--date=format:%Y%m%d', sha])
.stdout
spawnSync('git', [
'show',
'-s',
'--no-show-signature',
'--format=%cd',
'--date=format:%Y%m%d',
sha,
]).stdout
).trim();
// On CI environment, this string is wrapped with quotes '...'s