summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index a7a36cc7d0..86961d68d7 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1408,6 +1408,16 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
}
}
+ // If repo has become private, we need to set its actions to private.
+ if repo.IsPrivate {
+ _, err = e.Where("repo_id = ?", repo.ID).Cols("is_private").Update(&Action{
+ IsPrivate: true,
+ })
+ if err != nil {
+ return err
+ }
+ }
+
// Create/Remove git-daemon-export-ok for git-daemon...
daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
if repo.IsPrivate && com.IsExist(daemonExportFile) {