Repository navigation
fix(hooks): isolate fixture git context before push - #308
Merged
Merged
Conversation
Mathis (echobt)
marked this pull request as ready for review
September 21, 2026 18:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
Pushing from a linked worktree runs the pre-push tests with Git's repository environment. A fixture calling
git initcould then set the shared repository to bare and stage fixture files in the worktree being pushed. Subsequent repository operations failed even though the push succeeded.The pre-push hook clears Git's repository-local environment before running its existing checks. A regression performs a real push to a local remote, exercises the hook with a fixture-creating test runner, and verifies that the fixture has its own repository while the original configuration and staged changes remain intact.
Validation
Public contract
Review
Draft pending required CI and review checks. Greptile findings, if present, must be resolved on the current revision.
Risk
The change is limited to development tooling. The pre-commit hook retains its Git index context, including partial commits. No runtime migration or release is required.
Safe to merge: the linked-worktree push flow preserves the checkout while allowing fixture repositories to initialize independently.
What we checked:
Summary
The pre-push hook clears inherited Git repository context before its offline checks run, preventing fixture repositories created during those checks from changing the linked worktree being pushed. The added regression test verifies that staged changes, repository configuration, fixture state, and the pushed ref remain correct.
Reviews (1) · Last reviewed commit: "Merge branch 'main' into codex/fix-hook-..."