From 6c3f878a7e65f1b7e277850b22451ba7eb70f637 Mon Sep 17 00:00:00 2001 From: open_test Date: Wed, 11 May 2022 16:13:44 +0800 Subject: [PATCH] try to add env for pre-receive hook --- routers/private/hook.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routers/private/hook.go b/routers/private/hook.go index 38abd4953..9ff4bcfd9 100755 --- a/routers/private/hook.go +++ b/routers/private/hook.go @@ -199,6 +199,11 @@ func HookPreReceive(ctx *macaron.Context, opts private.HookOptions) { env = append(env, private.GitQuarantinePath+"="+opts.GitQuarantinePath) } + env = append(env, + models.EnvRepoSize+"="+fmt.Sprint(repo.Size), + models.EnvRepoMaxFileSize+"="+fmt.Sprint(setting.Repository.Upload.FileMaxSize), + models.EnvRepoMaxSize+"="+fmt.Sprint(setting.Repository.RepoMaxSize), + models.EnvPushSizeCheckFlag+"="+fmt.Sprint(setting.Repository.Upload.ShellFlag)) for i := range opts.OldCommitIDs { oldCommitID := opts.OldCommitIDs[i]