From 5e3dd3fafe1e8ca0f2aa1f832aa0326ede738581 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 25 May 2020 05:24:49 +0100 Subject: [PATCH] When initialising repositories ensure that the user doing the creation is the initializer (#11601) (#11608) Backport #11601 Fix #10760 Signed-off-by: Andrew Thornton --- modules/repository/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/repository/create.go b/modules/repository/create.go index 5c0aae30d..2f7d10f0d 100644 --- a/modules/repository/create.go +++ b/modules/repository/create.go @@ -47,7 +47,7 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *m // No need for init mirror. if !opts.IsMirror { repoPath := models.RepoPath(u.Name, repo.Name) - if err = initRepository(ctx, repoPath, u, repo, opts); err != nil { + if err = initRepository(ctx, repoPath, doer, repo, opts); err != nil { if err2 := os.RemoveAll(repoPath); err2 != nil { log.Error("initRepository: %v", err) return fmt.Errorf(