summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-18 15:01:11 -0500
committerUnknwon <u@gogs.io>2015-11-18 15:01:11 -0500
commit9a0902523b36dcf086aa0eafcfb9e93131bc027c (patch)
treee16a4a99ac9bb84cc9a881a28b04f9e6a1b4f702 /routers
parentd2808e38feff3cfb2b5ceb014d5f26a79a3c540f (diff)
downloadgitea-9a0902523b36dcf086aa0eafcfb9e93131bc027c.tar.gz
gitea-9a0902523b36dcf086aa0eafcfb9e93131bc027c.zip
fix #1987
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/setting.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index 089c939ec0..bee29254c5 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -85,6 +85,12 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
}
repo.Description = form.Description
repo.Website = form.Website
+
+ // Visibility of forked repository is forced sync with base repository.
+ if repo.IsFork {
+ form.Private = repo.BaseRepo.IsPrivate
+ }
+
visibilityChanged := repo.IsPrivate != form.Private
repo.IsPrivate = form.Private
if err := models.UpdateRepository(repo, visibilityChanged); err != nil {