Fix visibility of forked public repos from private orgs (#11717)
* Fix visibility of forked public repos from private orgs * update forks visibility when org visibility is changed Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
594db7fb43
commit
94f60e199b
5 changed files with 30 additions and 9 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
)
|
||||
|
||||
// ForkRepository forks a repository
|
||||
|
@ -36,7 +37,7 @@ func ForkRepository(doer, owner *models.User, oldRepo *models.Repository, name,
|
|||
LowerName: strings.ToLower(name),
|
||||
Description: desc,
|
||||
DefaultBranch: oldRepo.DefaultBranch,
|
||||
IsPrivate: oldRepo.IsPrivate,
|
||||
IsPrivate: oldRepo.IsPrivate || oldRepo.Owner.Visibility == structs.VisibleTypePrivate,
|
||||
IsEmpty: oldRepo.IsEmpty,
|
||||
IsFork: true,
|
||||
ForkID: oldRepo.ID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue