summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorCirno the Strongest <1447794+CirnoT@users.noreply.github.com>2020-06-07 02:45:12 +0200
committerGitHub <noreply@github.com>2020-06-06 20:45:12 -0400
commit94f60e199bc504c6cfb7b853889e3ceb2a837adc (patch)
tree4bfcb10071d6b8356863f11370d91b91b19894bc /models/repo.go
parent594db7fb433a386603c09676542bb0ec2e700935 (diff)
downloadgitea-94f60e199bc504c6cfb7b853889e3ceb2a837adc.tar.gz
gitea-94f60e199bc504c6cfb7b853889e3ceb2a837adc.zip
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>
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index fd2e75a0ea..bf7bf018a1 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1454,7 +1454,7 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
return fmt.Errorf("getRepositoriesByForkID: %v", err)
}
for i := range forkRepos {
- forkRepos[i].IsPrivate = repo.IsPrivate
+ forkRepos[i].IsPrivate = repo.IsPrivate || repo.Owner.Visibility == api.VisibleTypePrivate
if err = updateRepository(e, forkRepos[i], true); err != nil {
return fmt.Errorf("updateRepository[%d]: %v", forkRepos[i].ID, err)
}