Support copy protected branch from template repository (#25889)
Fix #14303
This commit is contained in:
parent
2b6f224336
commit
037c9895a7
8 changed files with 86 additions and 38 deletions
|
@ -355,16 +355,17 @@ func Generate(ctx *context.APIContext) {
|
|||
}
|
||||
|
||||
opts := repo_module.GenerateRepoOptions{
|
||||
Name: form.Name,
|
||||
DefaultBranch: form.DefaultBranch,
|
||||
Description: form.Description,
|
||||
Private: form.Private,
|
||||
GitContent: form.GitContent,
|
||||
Topics: form.Topics,
|
||||
GitHooks: form.GitHooks,
|
||||
Webhooks: form.Webhooks,
|
||||
Avatar: form.Avatar,
|
||||
IssueLabels: form.Labels,
|
||||
Name: form.Name,
|
||||
DefaultBranch: form.DefaultBranch,
|
||||
Description: form.Description,
|
||||
Private: form.Private,
|
||||
GitContent: form.GitContent,
|
||||
Topics: form.Topics,
|
||||
GitHooks: form.GitHooks,
|
||||
Webhooks: form.Webhooks,
|
||||
Avatar: form.Avatar,
|
||||
IssueLabels: form.Labels,
|
||||
ProtectedBranch: form.ProtectedBranch,
|
||||
}
|
||||
|
||||
if !opts.IsValid() {
|
||||
|
|
|
@ -241,15 +241,16 @@ func CreatePost(ctx *context.Context) {
|
|||
var err error
|
||||
if form.RepoTemplate > 0 {
|
||||
opts := repo_module.GenerateRepoOptions{
|
||||
Name: form.RepoName,
|
||||
Description: form.Description,
|
||||
Private: form.Private,
|
||||
GitContent: form.GitContent,
|
||||
Topics: form.Topics,
|
||||
GitHooks: form.GitHooks,
|
||||
Webhooks: form.Webhooks,
|
||||
Avatar: form.Avatar,
|
||||
IssueLabels: form.Labels,
|
||||
Name: form.RepoName,
|
||||
Description: form.Description,
|
||||
Private: form.Private,
|
||||
GitContent: form.GitContent,
|
||||
Topics: form.Topics,
|
||||
GitHooks: form.GitHooks,
|
||||
Webhooks: form.Webhooks,
|
||||
Avatar: form.Avatar,
|
||||
IssueLabels: form.Labels,
|
||||
ProtectedBranch: form.ProtectedBranch,
|
||||
}
|
||||
|
||||
if !opts.IsValid() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue