From f184d7ec5835fab460aadf336dfc98a994c370a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Tue, 7 Jun 2022 17:56:06 +0200 Subject: [PATCH] pr create: allow forking repositories with INTERNAL visibility The IsPrivate field of "internal" repositories is always true, but those repositories aren't truly private and absolutely can be forked. We shouldn't be checking for platform permissions in the client anyway, so let's just drop this check and have the platform decide whether this is a valid operation. --- pkg/cmd/pr/create/create.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 1c65046d5..f5691a563 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -588,9 +588,6 @@ func NewCreateContext(opts *CreateOptions) (*CreateContext, error) { return nil, cmdutil.CancelError } else { // "Create a fork of ..." - if baseRepo.IsPrivate { - return nil, fmt.Errorf("cannot fork private repository %s", ghrepo.FullName(baseRepo)) - } headBranchLabel = fmt.Sprintf("%s:%s", currentLogin, headBranch) } }