mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
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
This commit is contained in:
@@ -19,6 +19,7 @@ export const UNIT_SETUP_FILES = [
|
||||
'config/scripts/vitest-dom-setup.ts',
|
||||
'config/scripts/vitest-host-ports-setup.ts',
|
||||
'config/scripts/vitest-caller-identity-env-setup.ts',
|
||||
'config/scripts/vitest-inherited-git-env-setup.ts',
|
||||
'config/scripts/vitest-orcad-feature-readiness-reset.ts'
|
||||
]
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// 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]
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"./build-plugins/**/*",
|
||||
"./scripts/vitest-host-ports-setup.ts",
|
||||
"./scripts/vitest-caller-identity-env-setup.ts",
|
||||
"./scripts/vitest-inherited-git-env-setup.ts",
|
||||
"./scripts/vitest-real-agent-home-write-guard.ts",
|
||||
"./scripts/vitest-bun-node-builtins.ts",
|
||||
"./scripts/vitest-dom-setup.ts",
|
||||
|
||||
Reference in New Issue
Block a user