Skip to content

Commit 1544246

Browse files
authored
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.
1 parent 3d5f31f commit 1544246

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

cmd/hook.go

+1-12
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,7 @@ Gitea or set your environment appropriately.`, "")
181181
}
182182

183183
func runHookUpdate(c *cli.Context) error {
184-
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
185-
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
186-
fail(`Rejecting changes as Gitea environment not set.
187-
If you are pushing over SSH you must push with a key managed by
188-
Gitea or set your environment appropriately.`, "")
189-
} else {
190-
return nil
191-
}
192-
}
193-
194-
setup("hooks/update.log", false)
195-
184+
// Update is empty and is kept only for backwards compatibility
196185
return nil
197186
}
198187

0 commit comments

Comments
 (0)