mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
Initial open-source release
This commit is contained in:
commit
1a42152e6f
1199 changed files with 257054 additions and 0 deletions
20
packages/context/src/ingest/git-env.ts
Normal file
20
packages/context/src/ingest/git-env.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { type SimpleGit, simpleGit } from 'simple-git';
|
||||
|
||||
const PRE_COMMIT_GIT_ENV = [
|
||||
'GIT_ALTERNATE_OBJECT_DIRECTORIES',
|
||||
'GIT_CONFIG_COUNT',
|
||||
'GIT_CONFIG_PARAMETERS',
|
||||
'GIT_DIR',
|
||||
'GIT_EXEC_PATH',
|
||||
'GIT_INDEX_FILE',
|
||||
'GIT_PREFIX',
|
||||
'GIT_WORK_TREE',
|
||||
] as const;
|
||||
|
||||
export function createSimpleGit(baseDir?: string): SimpleGit {
|
||||
const env = { ...process.env };
|
||||
for (const key of PRE_COMMIT_GIT_ENV) {
|
||||
delete env[key];
|
||||
}
|
||||
return simpleGit(baseDir).env(env);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue