mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
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:
+1
-1
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user