fix(git): isolate catalog commands from parent hook environment
CI / check (push) Successful in 1m48s
CI / deploy (push) Successful in 1m26s
CI / e2e (push) Successful in 27s

This commit is contained in:
Simo committed 2026-09-05 19:57:19 +02:00
1 parent 816e3875c2
commit 98b0009206
4 files changed
+51 -2

No files matched your search

@@ -0,0 +1,19 @@
/** Git hooks export paths belonging to their repository. Never reuse them for a different checkout. */
export function gitProcessEnvironment(
source: NodeJS.ProcessEnv = process.env,
): NodeJS.ProcessEnv {
const environment = { ...source };
for (const name of [
"GIT_DIR",
"GIT_WORK_TREE",
"GIT_INDEX_FILE",
"GIT_COMMON_DIR",
"GIT_OBJECT_DIRECTORY",
"GIT_ALTERNATE_OBJECT_DIRECTORIES",
"GIT_PREFIX",
"GIT_IMPLICIT_WORK_TREE",
"GIT_GRAFT_FILE",
])
delete environment[name];
return environment;
}