Skip to content

Commit 296f31f

Browse files
committed
fix
1 parent 78932e5 commit 296f31f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

routers/web/repo/setting/setting.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,15 @@ func handleSettingsPostUpdate(ctx *context.Context) {
207207
repo.Website = form.Website
208208
repo.IsTemplate = form.Template
209209

210-
if err := repo_service.UpdateRepository(ctx, repo, false); err != nil {
210+
// Visibility of forked repository is forced sync with base repository.
211+
visibilityChanged := false
212+
if repo.IsFork {
213+
preVisibility := repo.IsPrivate
214+
repo.IsPrivate = repo.BaseRepo.IsPrivate || repo.BaseRepo.Owner.Visibility == structs.VisibleTypePrivate
215+
visibilityChanged = preVisibility != repo.IsPrivate
216+
}
217+
218+
if err := repo_service.UpdateRepository(ctx, repo, visibilityChanged); err != nil {
211219
ctx.ServerError("UpdateRepository", err)
212220
return
213221
}

0 commit comments

Comments
 (0)