Files
dsh-superagent/tests/fixtures/git.ts
T
2026-10-31 20:05:39 +08:00

10 lines
587 B
TypeScript

/** The environment of the git processes the tests start. */
import { GIT_LOCATION } from '../../src/infra/environment.ts'
/**
* The process environment with `extra`, and without the variables that tell git which repository to act on (`GIT_LOCATION`):
* the tests run inside `git rebase --exec` inherit GIT_DIR, and a `git init` there would reinitialize the repository under test.
*/
export const gitEnv = (extra: Record<string, string> = {}): Record<string, string | undefined> =>
({ ...process.env, ...Object.fromEntries(GIT_LOCATION.map(name => [name, undefined])), ...extra })