`git rebase <upstream> <branch>` checks out <branch>, so a later bare push was refused as if main
were still checked out. Pushes through xargs get refspecs the hook cannot see, so only an explicit
main is refused there.
Refs: #178
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
Review found pushes refused after `gh pr checkout` or `git branch -m`, and pushes to main allowed
after `git switch main` or `cd <repo>`. The hook now follows literal branch and directory changes
and treats any other as unknown. Heredoc stripping is linear and handles several per line.
Refs: #178
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
An agent on main can push straight to it when the server does not protect the branch. The git
plugin now ships a Claude Code hook that refuses such a push before it runs. It fails open, does
nothing on other runtimes, and has an opt-out read only from the hook's own environment.
Closes: #178
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi