mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-30 10:38:13 -05:00
fix(patch): forcibly disable ANSI color codes when generating patch diff (#9914)
Add `--no-color` to pnpm's invocation of `git diff` within the patch-commit command. Ensures that the .diff files are valid when operating inside of a git repository that has a local config that includes `diff.color=always`
This commit is contained in:
6
.changeset/honest-games-play.md
Normal file
6
.changeset/honest-games-play.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-patching": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Forcibly disable ANSI color codes when generating patch diff [#9914](https://github.com/pnpm/pnpm/pull/9914).
|
||||
@@ -151,7 +151,7 @@ async function diffFolders (folderA: string, folderB: string): Promise<string> {
|
||||
let stderr!: string
|
||||
|
||||
try {
|
||||
const result = await execa('git', ['-c', 'core.safecrlf=false', 'diff', '--src-prefix=a/', '--dst-prefix=b/', '--ignore-cr-at-eol', '--irreversible-delete', '--full-index', '--no-index', '--text', '--no-ext-diff', folderAN, folderBN], {
|
||||
const result = await execa('git', ['-c', 'core.safecrlf=false', 'diff', '--src-prefix=a/', '--dst-prefix=b/', '--ignore-cr-at-eol', '--irreversible-delete', '--full-index', '--no-index', '--text', '--no-ext-diff', '--no-color', folderAN, folderBN], {
|
||||
cwd: process.cwd(),
|
||||
env: {
|
||||
...process.env,
|
||||
|
||||
Reference in New Issue
Block a user