A repository's default branch (HEAD) is fixed by whatever the first push creates, and there is no supported way to change it afterwards.
Repro
git push buzz HEAD:main # local branch is actually `master`
git push buzz master relaunch-b
git push buzz --delete main
# remote: error: refusing to delete the current branch: refs/heads/main
The repo is now stuck advertising HEAD -> refs/heads/main, a branch that does not exist locally.
Why no client can fix it
Workaround
Delete the manifest pointer in object storage, then push the intended default branch first:
mc rm loc/<bucket>/repos/<community>/<owner>/<repo>/pointer
git push buzz master # HEAD now resolves to refs/heads/master
git push buzz relaunch-b
Re-publishing the kind:30617 announcement re-seeds the pointer, so this does not require deleting the repo. Note that a repo whose pointer is missing returns 404 repository not found even for git-receive-pack, because info_refs_subprocess uses hydrate_for_read for both services (transport.rs:726).
Expected
Either a way to set the default branch (CLI flag, kind:30617 tag, or desktop setting), or resolve_published_head honouring a delete of the current HEAD branch when other branches remain.
Buzz 0.4.26, self-hosted relay ghcr.io/block/buzz:main.
A repository's default branch (
HEAD) is fixed by whatever the first push creates, and there is no supported way to change it afterwards.Repro
The repo is now stuck advertising
HEAD -> refs/heads/main, a branch that does not exist locally.Why no client can fix it
init_bare_repohardcodessymbolic-ref HEAD refs/heads/main(hydrate.rs:183), so the first push always starts frommain.HEADfrom the manifest (hydrate.rs:369), so a server-sidegit symbolic-refdoes not survive — andrun_gitdeliberately isolates$HOME, soreceive.denyDeleteCurrentcannot be configured either.kind:30618HEAD ref and has no write path for it (hooks.ts:205-212).buzz repos createcannot rewrite it, and there is norepos rm(No way to delete a repo announcement (kind:30617): CLI has norepos rm, and Desktop 'Delete project' is owner-gated to keys the app holds #2326) to start over.Workaround
Delete the manifest pointer in object storage, then push the intended default branch first:
Re-publishing the
kind:30617announcement re-seeds the pointer, so this does not require deleting the repo. Note that a repo whose pointer is missing returns404 repository not foundeven forgit-receive-pack, becauseinfo_refs_subprocessuseshydrate_for_readfor both services (transport.rs:726).Expected
Either a way to set the default branch (CLI flag,
kind:30617tag, or desktop setting), orresolve_published_headhonouring a delete of the currentHEADbranch when other branches remain.Buzz
0.4.26, self-hosted relayghcr.io/block/buzz:main.