Set the default branch for repositories generated from templates (#19136)

* Set the default branch for repositories generated from templates
* Allows default branch to be set through the API for repos generated from templates
* Update swagger API template
* Only set default branch to the one from the template if not specified
* Use specified default branch if it exists while generating git commits

Fix #19082 

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
Abheek Dhawan 2022-03-26 21:56:28 -05:00 committed by GitHub
parent 71a5aaef32
commit f316582458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 20 deletions

View file

@ -201,6 +201,8 @@ type GenerateRepoOption struct {
// required: true
// unique: true
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
// Default branch of the new repository
DefaultBranch string `json:"default_branch"`
// Description of the repository to create
Description string `json:"description" binding:"MaxSize(255)"`
// Whether the repository is private