don't leak GIT_* env into `npm install` for `language: node` by cbirkhold · Pull Request #3774 · pre-commit/pre-commit · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
don't leak GIT_* env into npm install for language: node
When a node hook environment is installed from `git commit` inside a
submodule, git exports absolute GIT_DIR / GIT_INDEX_FILE paths.
`npm install git+file://<store clone>` inherited them, so npm's checkout
of the hook repository overwrote the submodule's index and the commit
failed with `fatal: unable to read <sha>`.

Run the install with no_git_env(), as is already done for the initial
clone in store.py.

Signed-off-by: Chris Birkhold <cbirkhold@gmail.com>
  • Loading branch information
cbirkhold authored and asottile committed Oct 12, 2026
commit 860d07d18211a0154ffaa4e77bf2a43c2b2473a9
3 changes: 2 additions & 1 deletion pre_commit/languages/node.py
23 changes: 23 additions & 0 deletions tests/languages/node_test.py
Loading