static struct command *commands;
static const char update_hook[] = "hooks/update";
+static const char pre_receive_hook[] = "hooks/pre-receive";
+static const char post_receive_hook[] = "hooks/post-receive";
static int run_hook(const char *hook_name,
struct command *first_cmd,
return;
}
+ if (run_hook(pre_receive_hook, commands, 0)) {
+ while (cmd) {
+ cmd->error_string = "pre-receive hook declined";
+ cmd = cmd->next;
+ }
+ return;
+ }
+
while (cmd) {
cmd->error_string = update(cmd);
cmd = cmd->next;
unlink(pack_lockfile);
if (report_status)
report(unpack_status);
+ run_hook(post_receive_hook, commands, 0);
run_update_post_hook(commands);
}
return 0;