diff --git a/tests/dev/test_gen_config_deploy.py b/tests/dev/test_gen_config_deploy.py index 99b656e..cae807c 100644 --- a/tests/dev/test_gen_config_deploy.py +++ b/tests/dev/test_gen_config_deploy.py @@ -105,8 +105,11 @@ def test_image_jobs_gate_on_changes_outputs_not_head_commit(): def _git(*args: str, cwd: Path) -> str: + # Drop GIT_DIR / GIT_INDEX_FILE / GIT_WORK_TREE: the pre-commit hook runs + # this file with them pointing at the real repo, which would redirect + # every call away from the temp repo under `cwd`. env = { - **os.environ, + **{k: v for k, v in os.environ.items() if not k.startswith("GIT_")}, "GIT_AUTHOR_NAME": "t", "GIT_AUTHOR_EMAIL": "t@example.invalid", "GIT_COMMITTER_NAME": "t",