claude-code-config
claude-code-config copied to clipboard
fix: narrow git push hook regex to avoid substring false positives
Fixes #46
The regex git[[:space:]]+push.*(main|master) matches "main" anywhere in the command, false-positiving on branches like deps/aiohttp-3.13.5-remaining or feature/maintain-state.
Requires main/master to be preceded by whitespace, :, /, or + and followed by whitespace or end-of-string — covering direct pushes, refspecs, fully-qualified refs, and force prefixes while allowing branch names containing these as substrings.
🤖 Generated with Claude Code