From 2e61ac9534020651b9e0a56a9ebc720c1aabb373 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Sun, 8 Nov 2026 04:07:39 +0100 Subject: [PATCH] test(worktrees): keep the system gitconfig out of the code under test (#776) The two stubs from #776 cover the global ignore file and the global config. A core.excludesFile in the system gitconfig still reached the code under test and failed the same test (reproduced with GIT_CONFIG_SYSTEM pointing at one). GIT_CONFIG_NOSYSTEM closes that, as test/git-hooks.test.ts already does for its code under test. Co-Authored-By: Claude Opus 5.5 --- test/git-worktrees.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/git-worktrees.test.ts b/test/git-worktrees.test.ts index 0aaf6ef7..75d95d91 100644 --- a/test/git-worktrees.test.ts +++ b/test/git-worktrees.test.ts @@ -209,8 +209,10 @@ describe('git worktrees on a real repository', () => { // The code under test runs git with the real process env. git reads the global ignore file // from $XDG_CONFIG_HOME/git/ignore, which GIT_CONFIG_GLOBAL does not cover: a user who // ignores `.claude/settings.local.json` globally would see that line silently not appended. + // A core.excludesFile in the system gitconfig does the same, hence GIT_CONFIG_NOSYSTEM. vi.stubEnv('XDG_CONFIG_HOME', join(dir, 'xdg')); vi.stubEnv('GIT_CONFIG_GLOBAL', '/dev/null'); + vi.stubEnv('GIT_CONFIG_NOSYSTEM', '1'); repoDir = join(dir, 'repo'); mkdirSync(repoDir); git(repoDir, 'init', '-q', '-b', 'main');