Update default ref to use refs/heads/main#727
Update default ref to use refs/heads/main#727techknowlogick wants to merge 1 commit intogo-git:masterfrom techknowlogick:main-switch
Conversation
|
This is a breaking change, I would rather tackle it in a way that would keep backwards compatibility. Additionally, I think the behaviour you are trying to achieve could be done using Line 96 in ce62f3e |
|
Thanks @pjbgf, yes it is indeed breaking, although it might be considered as breaking to align with changes to git client itself. I understand you have many downstreams you need to consider so I won't advocate for this breaking change past what I have already done. Sadly, I had also considered the config setting, but the specific issue I am facing can't be set by the default branch config setting. The I'd be happy to contribute a PR, perhaps to add a similar function, Something like: func Init(s storage.Storer, worktree billy.Filesystem) (*Repository, error) {
InitWithBranch(s, worktree, plumbing.Master)
}
func InitWithBranch(s storage.Storer, worktree billy.Filesystem, branch string) (*Repository, error) {
// ...
h := plumbing.NewSymbolicReference(plumbing.HEAD, branch)
// ... |
|
@techknowlogick apologies for the delay. Happy to review a PR on extending |
When creating new repositories, use refs/heads/main as the default ref
Related: charmbracelet/soft-serve#198