feat(clone): report the remote repository's default branch in the clone result #838
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#838
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
madtea cloneandmadt_clonedo not report the remote repository's default branch. After the fix for #684, the clone result reports only what the clone checked out:branch(empty on a detached HEAD) andtag. The olddefaultBranchfield held the checked-out branch, not the remote default, so it was removed.A clone result that also names the remote default would help a caller that cloned a tag or a feature branch and then wants to compare against the default. Nothing in madtea reads such a value today, so this is a feature, not a fix.
What git records after a clone
I probed this with git 2.47.3, against a source repo whose default branch is
trunk, with a branchfeatureand a tagv1:refs/remotes/origin/HEADorigin/trunk-b featureorigin/trunk-b v1origin/trunk--depth 1origin/trunk--depth 1 -b feature--depth 1 -b v1refs/tags/v1exists)--bareHEADistrunk)--bare -b feature--bare -b v1So no local ref gives the default in the single-branch and bare shapes. A full answer needs a second remote call there, for example
git ls-remote --symref origin HEADon the same transport and credential path as the clone, or the forge API'sdefault_branch.Acceptance criteria