claude-code-config icon indicating copy to clipboard operation
claude-code-config copied to clipboard

fix: narrow git push hook regex to avoid substring false positives

Open hbrodin opened this issue 8 months ago • 0 comments

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

hbrodin avatar Apr 02 '26 09:04 hbrodin