Skip to content

Commit

Permalink
Remove unnecessary loading of settings in update hook (#9496)
Browse files Browse the repository at this point in the history
This PR simply makes update an empty command rather than needlessly load the settings for each reference.
  • Loading branch information
zeripath committed Dec 27, 2019
1 parent 3d5f31f commit 1544246
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions cmd/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 1544246

Please sign in to comment.