Skip to content

Skip the Source-Only Refspec Mapping for a Delete Push in the Write Guard #3314

Closed

Description

@ptr727

Problem

The write guard's source-only refspec mapping (added for #3048 and #2943's persisted push config item) reads a --delete push's refspecs as if git mapped them. Git does not: it turns each --delete word into :<name> before any remote.<name>.push or push.default=upstream mapping is reached, so only the named branch is deleted.

The guard therefore reads a routine branch cleanup as deleting the branch the mapping names. This is an over-denial, found by the local review on the pull request closing #3048, and per that lane's rule it is filed rather than narrowed in the same pull request.

Reproduction (constructed repository)

  1. A checkout whose origin's develop carries a deletion or pull_request rule.
  2. git config push.default upstream, on a branch feature/example whose branch.feature/example.merge is refs/heads/develop (the shape git worktree add -b feature/example <path> origin/develop leaves).
  3. Classify git push origin --delete feature/example in that checkout.

The guard denies it as a write to develop. A real push there deletes only feature/example. A remote.origin.push of refs/heads/feature/example:refs/heads/develop gives the same denial.

Possible Direction

Skip the source-only mapping for a push carrying --delete (or -d, in any spelling _push_targets already reads as a delete), since git never maps it.

🤖 Generated with Claude Code

Activity

  1. added
    bugSomething isn't working
    scriptA defect in hub tooling
    on Oct 21, 2026
  2. ptr727 commented on Oct 24, 2026

    @ptr727
    OwnerAuthor

    Closed as resolved by the write guard rewrite (#3407, on main through promotion #3417). The command shape this issue records is one of the source-tagged cases in the rewritten guard's self-test corpus, so the shape is read the way the issue asks, and the corpus case is what keeps it so. Reopen with the command if a session still hits it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingscriptA defect in hub tooling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions