From fd941db246e66244ec81f43d74b8358c06173fd6 Mon Sep 17 00:00:00 2001 From: Denis Denisov Date: Tue, 21 Feb 2017 17:02:10 +0200 Subject: Protected branches system (#339) * Protected branches system * Moved default branch to branches section (`:org/:reponame/settings/branches`). * Initial support Protected Branch. - Admin does not restrict - Owner not to limit - To write permission restrictions * reformat tmpl * finished the UI and add/delete protected branch response * remove unused comment * indent all the template files and remove ru translations since we use crowdin * fix the push bug --- cmd/serve.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd/serve.go') diff --git a/cmd/serve.go b/cmd/serve.go index 7141d85c92..f4a3c3d2c6 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -342,6 +342,10 @@ func runServ(c *cli.Context) error { } else { gitcmd = exec.Command(verb, repoPath) } + + os.Setenv(models.ProtectedBranchAccessMode, requestedMode.String()) + os.Setenv(models.ProtectedBranchRepoID, fmt.Sprintf("%d", repo.ID)) + gitcmd.Dir = setting.RepoRootPath gitcmd.Stdout = os.Stdout gitcmd.Stdin = os.Stdin -- cgit v1.2.3