From 52550f0bee1b3cb8765550d3e7323f311ce61ffa Mon Sep 17 00:00:00 2001 From: Gowtham Munukutla Date: Sat, 10 Jul 2021 23:03:16 +0530 Subject: [PATCH] fix private repo creation in case of ignore templates --- pkg/cmd/repo/create/http.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/repo/create/http.go b/pkg/cmd/repo/create/http.go index 5cad4857a..3ceda3c0a 100644 --- a/pkg/cmd/repo/create/http.go +++ b/pkg/cmd/repo/create/http.go @@ -19,7 +19,7 @@ type repoCreateInput struct { OwnerID string `json:"ownerId,omitempty"` TeamID string `json:"teamId,omitempty"` - + Private bool `json:"private,omitempty"` HasIssuesEnabled bool `json:"hasIssuesEnabled"` HasWikiEnabled bool `json:"hasWikiEnabled"` GitIgnoreTemplate string `json:"gitignore_template,omitempty"` @@ -116,6 +116,11 @@ func repoCreate(client *http.Client, hostname string, input repoCreateInput, tem if input.GitIgnoreTemplate != "" || input.LicenseTemplate != "" { input.Visibility = strings.ToLower(input.Visibility) + + if input.Visibility == "private" { + input.Private = true + } + body := &bytes.Buffer{} enc := json.NewEncoder(body) if err := enc.Encode(input); err != nil {