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.
This commit is contained in:
Mislav Marohnić 2022-06-07 17:56:06 +02:00
parent 80f130184c
commit f184d7ec58

View file

@ -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)
}
}