You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read a Dash-Named Refspec After End-of-Options in the Write Guard #3029
Found by the local review of the change closing #3007. Develop's guard shares it. It was confirmed against git 2.47.3 in a throwaway repository, where git update-ref created a local ref whose name starts with --.
A Refspec After -- or --end-of-options That Starts With a Dash Is Not Read
Git's option parser ends options at a bare -- or at --end-of-options, and reads every later word as a positional, a dash-named one included. _push_targets' option loop has no such boundary, so it reads a later dash-named word as an option or drops it, and never as a refspec. With a local ref named like --x, git push origin -- --x:refs/heads/develop writes develop. The guard reads only the remote, takes the push as a bare push of the current branch, and allows it from a feature branch.
The change closing #3007 stops a --no-prune after the boundary from cancelling --prune. Every other option the loop reads only adds an op, so reading those past the boundary over-denies rather than allows.
Possible Direction
Read every word after the first -- or --end-of-options as a positional, the rule _args_before_double_dash already states for git clean. Keep reading those words for the ops they would add, so no verdict develop denies becomes an allow, and add a case for a dash-named refspec after each boundary.
Activity
Read Completed, Pruned, and Slash-Remote Push Targets in the Write Gu…
ptr727 commentedon Oct 15, 2026
Claimed for an engineering-track lane (handoff #3040 resume). Branch:
feature/guard-bare-push-target-3019. Predicted file set:host-setup/agent-safety/claude/gh-write-guard.py,host-setup/agent-safety/claude/test_install.py,host-setup/agent-safety/README.md,host-setup/agent-safety/claude/README.md.Read a Bare Push's Destination From Branch Config, a Persisted Mirror…