summaryrefslogtreecommitdiffstats
path: root/services/repository
diff options
context:
space:
mode:
authorTait Hoyem <tait@tait.tech>2020-09-27 19:20:52 +0000
committerGitHub <noreply@github.com>2020-09-27 15:20:52 -0400
commitc85c9d40c2744b8b76bfa66582bbe20ef3a01dff (patch)
tree444de12b5410c1f61ac2cc7be86989be80f5efd9 /services/repository
parent82179a6e81b4f712d523bd481b18a64c8eb99559 (diff)
downloadgitea-c85c9d40c2744b8b76bfa66582bbe20ef3a01dff.tar.gz
gitea-c85c9d40c2744b8b76bfa66582bbe20ef3a01dff.zip
Add config option to make create-on-push repositories public by default (#12936)
* Add config option to make create-on-push repositories public by default * Fix linting * Add option to 'config cheat sheet' page * Chinese translation Signed-off-by: a1012112796 <1012112796@qq.com> * Fix typo in docs * fix typo * Add option to example config Co-authored-by: Tait Hoyem <code@tait.tech> Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'services/repository')
-rw-r--r--services/repository/repository.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/repository/repository.go b/services/repository/repository.go
index c6768f3f00..88b1623934 100644
--- a/services/repository/repository.go
+++ b/services/repository/repository.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
repo_module "code.gitea.io/gitea/modules/repository"
+ cfg "code.gitea.io/gitea/modules/setting"
pull_service "code.gitea.io/gitea/services/pull"
)
@@ -88,7 +89,7 @@ func PushCreateRepo(authUser, owner *models.User, repoName string) (*models.Repo
repo, err := CreateRepository(authUser, owner, models.CreateRepoOptions{
Name: repoName,
- IsPrivate: true,
+ IsPrivate: cfg.Repository.DefaultPushCreatePrivate,
})
if err != nil {
return nil, err