Files
archived-orca/config/scripts/vitest-inherited-git-env-setup.ts
T
Neil a50b9964a1 test: clear inherited GIT_* env once per test file so real-Git suites cannot write into an outer repo (#35859)
* test: clear inherited GIT_* env once per test file so real-Git suites cannot write into an outer repo

* test: clear only repo-locating Git env so the compat lane keeps GIT_EXEC_PATH
2026-10-29 02:40:33 -07:00

15 lines
388 B
TypeScript

// A hook's repo-locating Git env would aim real-Git suites at the outer repo; keep GIT_EXEC_PATH and config, which the compat lane sets.
for (const name of [
'GIT_DIR',
'GIT_WORK_TREE',
'GIT_INDEX_FILE',
'GIT_COMMON_DIR',
'GIT_OBJECT_DIRECTORY',
'GIT_ALTERNATE_OBJECT_DIRECTORIES',
'GIT_NAMESPACE',
'GIT_PREFIX',
'GIT_QUARANTINE_PATH'
]) {
delete process.env[name]
}