Browse Source

Remove unnecessary loading of settings in update hook (#9496)

This PR simply makes update an empty command rather than needlessly load the settings for each reference.
for-closed-social
zeripath 4 years ago
committed by GitHub
parent
commit
154424623a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 12 deletions
  1. +1
    -12
      cmd/hook.go

+ 1
- 12
cmd/hook.go View 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
}

Loading…
Cancel
Save