Skip to content

Commit

Permalink
fix(core): hide leaky error message from git show command in affected (
Browse files Browse the repository at this point in the history
…#12521)

(cherry picked from commit f37c334)
  • Loading branch information
AgentEnder authored and FrozenPandaz committed Oct 11, 2022
1 parent eb0f030 commit f98af61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/nx/src/project-graph/file-utils.ts
Expand Up @@ -89,9 +89,9 @@ export function calculateFileChanges(
}
switch (ext) {
case '.json':
const atBase = readFileAtRevision(f, nxArgs.base);
const atHead = readFileAtRevision(f, nxArgs.head);
try {
const atBase = readFileAtRevision(f, nxArgs.base);
const atHead = readFileAtRevision(f, nxArgs.head);
return jsonDiff(JSON.parse(atBase), JSON.parse(atHead));
} catch (e) {
return [new WholeFileChange()];
Expand Down Expand Up @@ -122,6 +122,7 @@ function defaultReadFileAtRevision(
? readFileSync(file, 'utf-8')
: execSync(`git show ${revision}:${filePathInGitRepository}`, {
maxBuffer: TEN_MEGABYTES,
stdio: ['pipe', 'pipe', 'ignore'],
})
.toString()
.trim();
Expand Down

0 comments on commit f98af61

Please sign in to comment.