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 Matching Push Without Relying on Remote-Tracking Refs in the Write Guard #3315
The write guard reads a matching push (push.default=matching, or a lone : refspec) as every local branch with a same-named remote-tracking ref of its remote, the design #3053 chose. Git instead compares the local branches with the refs the remote actually holds. The proxy therefore misses a local branch whose remote counterpart has no remote-tracking ref here, which is not a gap the design call removed but one it accepted:
A single-branch clone, or a fetch refspec narrowed or remapped away from refs/remotes/<remote>/*.
A remote branch created since the last fetch.
A git fetch earlier in the same command, which adds remote-tracking refs after the guard has listed them. The guard fails closed on a command before the push that may move a local ref, but fetch is not one of those.
Found by the local review on the pull request closing #3048 and #3053, where a branch under a non-default ruleset (such as release/1 under release/*) is the case that matters.
Reproduction (constructed repository)
A checkout with a local release/1 and no refs/remotes/origin/release/1, while the remote does hold release/1 under a release/* ruleset.
git config push.default matching.
Classify git push there.
The guard allows it. A real push updates release/1 on the remote.
Possible Direction
Read a matching push as every local branch, a superset that never misses one, or fail closed where a fetch runs before the push in the same command. Choosing between them is a design question, since the first changes the call #3053 made.
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
Judge a Push Against the Repository and Branches It Actually Writes (#…
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.