diff options
author | Unknwon <u@gogs.io> | 2015-10-25 04:26:26 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-10-25 04:26:26 -0400 |
commit | 022820103d622dda74aa1c619ca46838a14b762a (patch) | |
tree | 2de093f709bb04c366cee4ebb73dcc3230f7019a /routers/api | |
parent | d5fab7f1b993ac389d751bfb87774549c4f3f4c2 (diff) | |
download | gitea-022820103d622dda74aa1c619ca46838a14b762a.tar.gz gitea-022820103d622dda74aa1c619ca46838a14b762a.zip |
#1657 allow forcing all private repos
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/repo.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/routers/api/v1/repo.go b/routers/api/v1/repo.go index 712655bf40..5a00267778 100644 --- a/routers/api/v1/repo.go +++ b/routers/api/v1/repo.go @@ -237,7 +237,13 @@ func MigrateRepo(ctx *middleware.Context, form auth.MigrateRepoForm) { return } - repo, err := models.MigrateRepository(ctxUser, form.RepoName, form.Description, form.Private, form.Mirror, remoteAddr) + repo, err := models.MigrateRepository(ctxUser, models.MigrateRepoOptions{ + Name: form.RepoName, + Description: form.Description, + IsPrivate: form.Private || setting.Repository.ForcePrivate, + IsMirror: form.Mirror, + RemoteAddr: remoteAddr, + }) if err != nil { if repo != nil { if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID); errDelete != nil { |