From 157b4057531b99b2d3b5c086f385c830aa38354f Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 16 Jun 2022 23:47:44 +0800 Subject: Remove legacy git code (ver < 2.0), fine tune markup tests (#19930) * clean git support for ver < 2.0 * fine tune tests for markup (which requires git module) * remove unnecessary comments * try to fix tests * try test again * use const for GitVersionRequired instead of var * try to fix integration test * Refactor CheckAttributeReader to make a *git.Repository version * update document for commit signing with Gitea's internal gitconfig * update document for commit signing with Gitea's internal gitconfig Co-authored-by: Andrew Thornton Co-authored-by: Lunny Xiao --- cmd/hook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/hook.go b/cmd/hook.go index 8078763b18..73386038b3 100644 --- a/cmd/hook.go +++ b/cmd/hook.go @@ -308,6 +308,8 @@ func runHookPostReceive(c *cli.Context) error { ctx, cancel := installSignals() defer cancel() + setup("hooks/post-receive.log", c.Bool("debug")) + // First of all run update-server-info no matter what if _, _, err := git.NewCommand(ctx, "update-server-info").RunStdString(nil); err != nil { return fmt.Errorf("Failed to call 'git update-server-info': %v", err) @@ -318,8 +320,6 @@ func runHookPostReceive(c *cli.Context) error { return nil } - setup("hooks/post-receive.log", c.Bool("debug")) - if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 { if setting.OnlyAllowPushIfGiteaEnvironmentSet { return fail(`Rejecting changes as Gitea environment not set. -- cgit v1.2.3