Optimise the no-op post-commit hook in the web edit case by skipping loading plugins. (Particularly a win when using external plugins.)

master
Joey Hess 2008-10-23 14:08:45 -04:00
parent 534f714478
commit 8821ba3a59
2 changed files with 8 additions and 0 deletions

2
debian/changelog vendored
View File

@ -31,6 +31,8 @@ ikiwiki (2.68) UNRELEASED; urgency=low
* external: RPC functions can be injected to replace exported functions.
* Updated Spanish translation from the ever vigilant Victor Moral.
* Updated Danish translation from Jonas Smedegaard. Closes: #503117
* Optimise the no-op post-commit hook in the web edit case by skipping
loading plugins. (Particularly a win when using external plugins.)
-- Joey Hess <joeyh@debian.org> Fri, 17 Oct 2008 20:11:02 -0400

View File

@ -118,6 +118,12 @@ sub getconfig () { #{{{
error("WRAPPED_OPTIONS: $@");
}
delete $ENV{WRAPPED_OPTIONS};
# optimisation for no-op post_commit
if ($config{post_commit} && ! commit_hook_enabled()) {
exit 0;
}
loadplugins();
checkconfig();
}