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
fix(hooks): test fixtures write core.bare=true to the main checkout's git config #251
In a linked worktree, git commit exports GIT_DIR=<main>/.git/worktrees/<name> and GIT_INDEX_FILE to the pre-commit hooks. Hook test fixtures that run git init <tmp> and inherit them re-initialize that git dir, guess it's bare (the path doesn't end in .git), and write core.bare = true to the main checkout's shared .git/config. That breaks the main checkout and blocks new worktree sessions. The fixture commits (base, drop the companion) also land on the worktree's branch.
It happened on 2026-11-15 and again on 2026-11-16. The reflogs of several ai-toolkit worktrees on main's hooks show the fixture commits. The source is tests/test_apm_external_skills.pyWorkTreeTests (#240), which the apm-external-skills hook runs wherever bare python3 is a real Python. tests/test_hook_scripts.pyFeatureBranchPushTest has the same pattern (CI only today).
Fix
Drop GIT_* variables in every fixture suite that runs git, as test_renovate_prs.py already does.
Add a regression test, run by a pre-commit hook and in CI. It runs the git-fixture suites with a linked worktree's hook environment against a throwaway repo and fails if that repo's config, refs or index change.
Activity
test(hooks): decode git output as UTF-8 in test_hook_git_env
test(hooks): keep SKIP_PUSH_APPROVAL out of the push-hook fixture env
fix(hooks): check that test fixtures leave a worktree's shared git co…
test(hooks): decode git output as UTF-8 in test_hook_git_env
test(hooks): keep SKIP_PUSH_APPROVAL out of the push-hook fixture env