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 Every Branch a Persisted Mirror Push Writes in the Write Guard #3326
A remote with a persisted remote.<name>.mirror=true turns a push naming no refspec into a mirror push, which force-updates and deletes every branch on that remote. The write guard reads that key, but a positive read only adds the protected default branches as targets. A ruled non-default branch, such as a release/ branch requiring a pull request, is never queried, so the push is allowed while git mirrors over it. An explicit --mirror push to the same remote reads every branch and is denied.
Found while answering the Copilot round on the promotion pull request #3321, whose headline names mirror detection without a thread.
Reproduction
Constructed checkout: origin at example/alpha, where any release/ branch requires a pull request, and upstream at example/beta, where develop does. A local release/1 branch exists. Each command was classified by the guard at main and at develop:
The second and third commands mirror over release/1 on example/alpha. Main allows them too, so this is a gap the two branches share, not one the promotion added. The fourth is denied only because the ruled branch there is a protected default.
Expected
A persisted mirror read as true is judged the way an explicit --mirror push to the same remote is, reading every branch it writes, so a ruled non-default branch denies it.
Acceptance
The second and third commands above are denied, and the first and fourth keep their result.
A develop-versus-branch differential over the guard's self-test cases shows no deny-to-allow flip.
Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.
Activity
ptr727 commentedon Oct 23, 2026
Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.