diff --git a/.agents/skills/orchestrate-sdlc/scripts/worktree_control_test.py b/.agents/skills/orchestrate-sdlc/scripts/worktree_control_test.py index eaddb0c0e..f285ed0cb 100644 --- a/.agents/skills/orchestrate-sdlc/scripts/worktree_control_test.py +++ b/.agents/skills/orchestrate-sdlc/scripts/worktree_control_test.py @@ -26,6 +26,18 @@ def setUp(self): self.remote = base / "remote.git" self.repo = base / "repo" self.bazel_log = base / "bazel.log" + # Host git config, especially system hooks, must not reach these repositories. + patcher = mock.patch.dict( + os.environ, + { + "GIT_CONFIG_NOSYSTEM": "1", + "GIT_CONFIG_GLOBAL": os.devnull, + "FAKE_BAZEL_LOG": str(self.bazel_log), + "FAKE_BAZEL_EXIT": "0", + }, + ) + patcher.start() + self.addCleanup(patcher.stop) run(base, "init", "--bare", "-b", "main", str(self.remote)) run(base, "init", "-b", "main", str(self.repo)) (self.repo / "file.txt").write_text("one\n") @@ -37,9 +49,6 @@ def setUp(self): run(self.repo, "commit", "-m", "initial") run(self.repo, "remote", "add", "origin", str(self.remote)) run(self.repo, "push", "origin", "main") - patcher = mock.patch.dict(os.environ, {"FAKE_BAZEL_LOG": str(self.bazel_log), "FAKE_BAZEL_EXIT": "0"}) - patcher.start() - self.addCleanup(patcher.stop) def assert_kept(self, path): self.assertTrue(path.exists())