From ae98a0089ff7f7641ed15ddd595797de56eb49f1 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Fri, 16 Jan 2009 20:09:59 +0100 Subject: Move run_hook() from builtin-commit.c into run-command.c (libgit) A function that runs a hook is used in several Git commands. builtin-commit.c has the one that is most general for cases without piping. The one in builtin-gc.c prints some useful warnings. This patch moves a merged version of these variants into libgit and lets the other builtins use this libified run_hook(). The run_hook() function used in receive-pack.c feeds the standard input of the pre-receive or post-receive hooks. This function is renamed to run_receive_hook() because the libified run_hook() cannot handle this. Mentored-by: Daniel Barkalow Mentored-by: Christian Couder Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- run-command.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'run-command.h') diff --git a/run-command.h b/run-command.h index a8b0c209e..0211e1d47 100644 --- a/run-command.h +++ b/run-command.h @@ -49,6 +49,8 @@ int start_command(struct child_process *); int finish_command(struct child_process *); int run_command(struct child_process *); +extern int run_hook(const char *index_file, const char *name, ...); + #define RUN_COMMAND_NO_STDIN 1 #define RUN_GIT_CMD 2 /*If this is to be git sub-command */ #define RUN_COMMAND_STDOUT_TO_STDERR 4 -- cgit v1.2.1