From abc8598100caa0124a90aaeaa9098352f1af5a6a Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Fri, 9 Oct 2026 17:50:07 +0200 Subject: [PATCH] test(git): pin gitNonInteractiveEnv()'s locale so a revert fails in CI CI runs in an English locale, where git already answers in English, so the real-git clone tests stay green even if the LC_ALL/LANG pin from the previous commit is dropped. A pure assertion on the env is the only check that fails then. It also covers LANGUAGE, which gettext ignores once LC_ALL is C. Refs #568 Co-Authored-By: Claude Opus 5.5 (1M context) --- test/git-clone.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/git-clone.test.ts b/test/git-clone.test.ts index 9b588055..9da829e8 100644 --- a/test/git-clone.test.ts +++ b/test/git-clone.test.ts @@ -239,6 +239,14 @@ describe('gitNonInteractiveEnv', () => { it("does not override a user's own GIT_SSH_COMMAND", () => { expect(gitNonInteractiveEnv({ GIT_SSH_COMMAND: 'ssh -F /custom' }).GIT_SSH_COMMAND).toBe('ssh -F /custom'); }); + + // Issue #568. CI runs in an English locale, so the real-git tests below cannot + // catch a revert: only this assertion fails if the pin is dropped. + it("pins git's messages to English over the host's locale, since classifyGitFailure() matches English stderr", () => { + const env = gitNonInteractiveEnv({ LC_ALL: 'de_DE.UTF-8', LANG: 'de_DE.UTF-8', LANGUAGE: 'de' }); + expect(env.LC_ALL).toBe('C'); + expect(env.LANG).toBe('C'); + }); }); describe('parseLsRemoteOutput', () => {