mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-24 08:35:19 -04: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
|
let stderr!: string
|
||||||
|
|
||||||
try {
|
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(),
|
cwd: process.cwd(),
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
|
|||||||
Reference in New Issue
Block a user