mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-25 15:07:06 -04:00
* fix(patch): prevent git config path errors in patch-commit Replace HOME='' with GIT_CONFIG_GLOBAL to bypass user config without breaking home directory resolution in restricted environments. Fixes #6537 * fix(patch): prevent git config path errors in patch-commit Use GIT_CONFIG_NOSYSTEM and GIT_CONFIG_GLOBAL to bypass git config without breaking HOME path resolution in restricted environments. Fixes #6537
12 lines
733 B
Markdown
12 lines
733 B
Markdown
---
|
|
"@pnpm/plugin-commands-patching": patch
|
|
"pnpm": patch
|
|
---
|
|
|
|
Fixed `pnpm patch-commit` failing with "unable to access '/.config/git/attributes': Permission denied" error in environments where HOME is unset or non-standard (Docker containers, CI systems).
|
|
|
|
The issue occurred because pnpm was setting `HOME: ''` and `USERPROFILE: ''` to suppress user git configuration when running `git diff`. This caused git to resolve the home directory (`~`) as root (`/`), leading to permission errors when attempting to access `/.config/git/attributes`.
|
|
|
|
Now uses `GIT_CONFIG_GLOBAL: os.devNull` instead, which is git's proper mechanism for bypassing user-level configuration without corrupting the home directory path resolution.
|
|
|
|
Fixes #6537 |