You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clear Repository-Location Variables in Every Temporary-Repository Test Through One Helper #3324
A test or self-test that builds a temporary repository with git -C <tmp> or cwd=<tmp> inherits any GIT_DIR, GIT_WORK_TREE, or GIT_INDEX_FILE in its environment. A git hook sets these, so a suite run from a hook writes its init, config, and commits into the hook's own repository instead of the temporary one.
#3323 fixes this inside the write guard's --selftest, which clears the repository-location variables once around every case. The guard installs as one standalone file, so it cannot share that primitive, and the other sites carry their own differing lists or none:
spec/audit.py_selftest: its temporary repositories (the deletion probe and the cases after it) run git init, git config user.email, git add, and git commit with cwd= and no clearing at all. The file has no GIT_DIR handling anywhere, so this is the destructive case.
host-setup/agent-safety/claude/test_install.py, TestAliasReadThroughLinkedWorktreeGitfile: drops GIT_DIR, GIT_WORK_TREE, GIT_COMMON_DIR, and GIT_OBJECT_DIRECTORY, but not GIT_INDEX_FILE, which a pre-commit hook sets, before its commit and worktree add.
tests/test_pr_review.py_DISCOVERY_VARS / _clean_env, tests/test_pre_commit_hook.py (strips by the GIT_ prefix), and scripts/local_review.pyINHERITED_REDIRECTS (three names): each a different variant of the same list.
Reproduction
Construct a scratch repository, point GIT_DIR at its .git, and run python3 spec/audit.py --selftest. The scratch repository's config and history change.
Expected
One shared helper for the scripts and tests that can import it, holding the full repository-location list, with every site above moved onto it. spec/audit.py's self-test comes first, since it clears nothing.
Activity
Run the Write Guard Self-Test Without an Ambient GIT_DIR (#3323)
Remove Location Variables Set Inside the Cleared Context
Skip the Audit Self-Test Case on Windows
Share One Git Location Variable List Across Self-Tests (#3335)
Read Every Launcher and Exported Git Directory in the Write Guard (#3342