Optimise the no-op post-commit hook in the web edit case by skipping loading plugins...
[ikiwiki.git] / ikiwiki.in
index 973ae3b3181df334c3b090d1fb433c326d4748d9..fd21b49112527343c6f63e9eae88f7506a9eb134 100755 (executable)
@@ -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();
        }
@@ -184,7 +190,7 @@ sub main () { #{{{
                # do nothing
        }
        else {
-               if ($config{rebuild}}) {
+               if ($config{rebuild}) {
                        debug(gettext("rebuilding wiki.."));
                }
                else {