Recipe default branch selection #394
Labels
No Label
abra
abra-gandi
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
democracy
design
documentation
duplicate
enhancement
finance
funding
good first issue
help wanted
installer
kadabra
performance
proposal
question
recipes.coopcloud.tech
security
test
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/organising#394
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
I run into trouble while upgrading https://git.coopcloud.tech/coop-cloud/onlyoffice because this repo has two branches
main
andmaster
, but it's default ismain
. The functionGetDefaultBranch
prefersmaster
overmain
.There should be either a better way to find out wich is really the default branch or the selection preference should be at least documented anywhere.
My fix was to remove the old master branch and delete the local directory.
@moritz
FYI I did run in to a bug in that code again in coop-cloud/abra#261 and pushed a new fix based on various
go-git
chaotic API surface compromises... hopefully still working now 🤞Yeh, the default branch choice stuff, it's actually loaded into the
RecipeMeta
which reads from the repository settings and gets the default branch. The only thing is that reading that and passing it down the stack for more low-level git repository operations has proved awkward.A refactor could be to do some single repository query or caching to get the default branch from the gitea API and then attach that to the
Recipe
struct itself? Then it's always available? But then not ideal for this offline scenario...This could definitely be improved, yeh.