don't leak GIT_* env into `npm install` for `language: node` · pre-commit/pre-commit@860d07d · GitHub
Skip to content

Commit 860d07d

Browse files
cbirkholdasottile
authored andcommitted
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>
1 parent 9ad8a0a commit 860d07d

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

‎pre_commit/languages/node.py‎

Lines changed: 2 additions & 1 deletion

‎tests/languages/node_test.py‎

Lines changed: 23 additions & 0 deletions

0 commit comments

Comments
 (0)