Skip to content

fix: isolate pre-push Git environment - #47

Merged
CaptSilver merged 1 commit into
CaptSilver:mainfrom
VenRoot:fix/pre-push-git-environment
Nov 8, 2026
Merged

CaptSilver merged 1 commit into
CaptSilver:mainfrom
VenRoot:fix/pre-push-git-environment

Conversation

@VenRoot

@VenRoot VenRoot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

What

Clear the repository-local environment exported by Git before the pre-push hook runs preflight.

Why

In linked worktrees, fixture Git commands can inherit the pushed worktree's GIT_DIR/index and read or modify the wrong repository. Save the hook root, unset the variables returned by git rev-parse --local-env-vars, then run the existing gate with unchanged marker/ref behavior.

Test plan

  • Complete default preflight passes in isolation — established upstream font-test blockers remain; no full gate pass claimed.
  • Fresh compatibility check against upstream 474dc8a: conflict-free merge; both changed files remain unchanged upstream.
  • Hook regression 18/18 passed; marker suite 35/35 passed. The original hook failed the new linked-worktree regression.
  • Previous lint, Bash syntax and whitespace checks passed. ShellCheck unavailable.

Notes for reviewer

Only tools/scripts/git-hooks/pre-push and tools/scripts/tests/test-pre-push-hook.sh change. The regression invokes a real hook and safely reads a foreign fixture's absolute Git directory. No gate bypass, pointer change, hook configuration change or dependency on another source contribution.

Upstream fd78ba1 separately fixes mutation.sh's temporary-path cleanup trap; that does not fix Git environment contamination and is not included here. Draft while existing full-gate limitations remain.

@CaptSilver
CaptSilver marked this pull request as ready for review November 8, 2026 19:53
@CaptSilver
CaptSilver merged commit 5d1d32e into CaptSilver:main Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants