Skip to content

Clear repository-local Git environment before pre-push tests #2967

Description

@JoshCLWren

While validating #2965 from a local worktree, the real pre-push hook passes Git repository-local environment variables into pytest. GIT_DIR points to the originating worktree and GIT_CONFIG_PARAMETERS can carry its hook override. Tests that create temporary repositories then fail during setup or run the wrong hooks; the same test files pass outside the hook.

Required fix: clear Git's repository-local environment before launching the pre-push validation commands, while retaining the real hooks and all validation gates. Add regression coverage proving temporary repositories remain independent under a worktree-style hook environment.

Discovered while fixing #2965; resolving this is needed to complete the local push validation for that issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions