This repository has been archived on 2026-08-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
pi-web/src/server/git/gitEnv.test.ts
T

18 lines
491 B
TypeScript

import { describe, expect, it } from "vitest";
import { sanitizedGitEnv } from "./gitEnv.js";
describe("sanitizedGitEnv", () => {
it("removes repository-local Git variables inherited from hooks", () => {
const env = sanitizedGitEnv({
PATH: "/bin",
GIT_DIR: "/repo/.git",
GIT_WORK_TREE: "/repo",
GIT_INDEX_FILE: "/repo/.git/index.lock",
GIT_PREFIX: "src/",
GIT_COMMON_DIR: "/repo/.git",
});
expect(env).toEqual({ PATH: "/bin" });
});
});