Skip to content

toolchain: default-branch detection — non-origin clone with unpushed branch falls back to possibly-absent origin #483

Description

@kyle-sexton

Category: bug (deferred edge, tracked follow-up for PR #467) · Source: pre-merge digest — the edge was validly deferred in-thread but had no durable issue, so the trigger would not survive the merge.

Edge

When branch.<current>.remote is unset and origin/HEAD is absent (non-origin clone, unpushed feature branch), detection forces REMOTE=origin, which may not exist. Degrades gracefully today ("branch diff unavailable" — visible, not silently wrong), common case unaffected.

Fix direction (from the PR thread)

Select a present remote instead of assuming origin; consider adopting git-tree-reset.sh's authoritative fallback (gh repo view --json defaultBranchRef, L109-113) as a SHARED default-branch helper — the same shape #436 (review: origin/main baked across ~7 surfaces) and #442 (source-control origin hardcoded) need. Fixing the class once beats three local fixes.

Related

PR #467 (in-thread deferral record) · #411 (source issue) · #436 · #442

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highSignificant impact, or blocks an imminent release; staff this cycle.status: readyTriaged, unblocked, and fully specified; eligible to pick up.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions