Skip to content

Ignore git warnings when diffing patch folders - #7271

Open
Hashim1999164 wants to merge 1 commit into
yarnpkg:masterfrom
Hashim1999164:fix/patch-commit-git-warnings
Open

Ignore git warnings when diffing patch folders#7271
Hashim1999164 wants to merge 1 commit into
yarnpkg:masterfrom
Hashim1999164:fix/patch-commit-git-warnings

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Sep 6, 2026

Copy link
Copy Markdown

Fixes #7269

git diff writes warnings to stderr even when the diff itself is fine, for example when HOME is empty and git cannot read git attributes. patch commit treated any stderr as a hard failure.

Ignore warning lines and only throw when stderr has a real git error.

Test plan

Added a unit test that feeds a warning on stderr and still returns the diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: patch-commit throws when git diff produces warnings

1 participant