]> source.dussan.org Git - gitea.git/commitdiff
Remove unnecessary loading of settings in update hook (#9496)
authorzeripath <art27@cantab.net>
Fri, 27 Dec 2019 15:21:33 +0000 (15:21 +0000)
committerGitHub <noreply@github.com>
Fri, 27 Dec 2019 15:21:33 +0000 (15:21 +0000)
This PR simply makes update an empty command rather than needlessly load the settings for each reference.

cmd/hook.go

index 03fa15aabc0724da8f055424ea9ec1004d76c168..ebd230999a5318a30f947dbde42e78105b624ddf 100644 (file)
@@ -181,18 +181,7 @@ Gitea or set your environment appropriately.`, "")
 }
 
 func runHookUpdate(c *cli.Context) error {
-       if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
-               if setting.OnlyAllowPushIfGiteaEnvironmentSet {
-                       fail(`Rejecting changes as Gitea environment not set.
-If you are pushing over SSH you must push with a key managed by
-Gitea or set your environment appropriately.`, "")
-               } else {
-                       return nil
-               }
-       }
-
-       setup("hooks/update.log", false)
-
+       // Update is empty and is kept only for backwards compatibility
        return nil
 }