Repository navigation
Description
Context
The pull request fixing the Copilot findings on #2950 held its review to those findings and shapes in their class. These gaps sit beside them, are each allowed by develop's guard as well, and are not listed in #2943, so they are collected here. Each was found by a classify probe on constructed commands, with the branch rules given as a test seam.
Push Operations Read Under One Aggregate Flag
_push_targets keeps one force and one delete flag per push, and a +src or :dst refspec sets it for every branch the push names. A force or delete op is then never checked against pull_request, only against non_fast_forward/required_linear_history or deletion. Under a branch whose rules hold pull_request but not the others, each of these passes:
git push --force origin developgit push origin +feature/x develop, which readsdevelopas a force update although it is an ordinary onegit push origin :feature/z develop, which readsdevelopas a deletion although it is an update
The fleet's code rules carry non_fast_forward and deletion beside pull_request, so a fleet branch denies these today. A repository with a looser ruleset does not.
Config Included From a File
git -c include.path=/example/config p reads the alias p from a file the guard never reads, so a push alias defined there passes. A -c on a push itself is already denied, so the gap is a subcommand the included file defines. This sits beside #2943's persisted-alias and --config-env alias entries but is not one of them.
A Separator Fused With a Redirection
The tokenizer fuses a separator with a following redirection into one token, such as ;<, &<, &&<, |<, or a newline and <. _collect_arglist reads any operator token holding < or > as a redirection, skips the next word as its target, and then reads the following command's words as the push's own arguments. So on a develop checkout git push ;</dev/null origin feature/example and git push &</dev/null origin feature/example read as an explicit push to feature/example, while bash runs a bare git push on develop and then a command named origin. git push |</dev/null git config push.default matching passes the same way. So do git push |</dev/null gh pr checkout 5, which pipes a bare push into a branch switch, and git push ;</dev/null gh pr checkout 5 && git push origin feature/example, since the guard reads the later command's words as explicit refspecs and never reads HEAD.
Possible Direction
Read each refspec's operation on its own, and check every op that writes a branch, a force or a delete included, against pull_request. Treat an include.path/includeIf override on a git command whose subcommand is not a builtin as a config value the guard cannot read, failing closed the way a -c push alias already does. Split a fused leading separator off an operator token before reading the rest as a redirection, in _collect_arglist and _forks_out_of_reach alike.
Activity
Read Each Push's Own Head Moves, Attached -c, and a Lone Colon in the…
Read Each Refspec's Push Operation, Include Overrides, and Fused Sepa…
Read Clustered and Cut-Short Push Options, Branch Patterns, List Expa…