go-git-providers
go-git-providers copied to clipboard
Add a test case for setting the default branch when creating a repo
Stemming from comment https://github.com/fluxcd/go-git-providers/pull/61#issuecomment-702702062
To ensure that setting the default branch of a repo at creation time is functional, it should be covered in a test case in the integration tests. Creating a github repo belonging to a user with the default branch set to deploy
for example, can be done with:
repo, err := c.OrgRepositories().Create(ctx, repoRef, gitprovider.RepositoryInfo{
Description: gitprovider.StringVar("foo"),
DefaultBranch: gitprovider.StringVar("deploy")
}, &gitprovider.RepositoryCreateOptions{
AutoInit: gitprovider.BoolVar(true),
LicenseTemplate: gitprovider.LicenseTemplateVar(gitprovider.LicenseTemplateApache2),
})