diff options
author | Johannes Sixt <j6t@kdbg.org> | 2009-06-08 22:34:29 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-06-09 00:15:57 -0700 |
commit | 0077138cd9d4f94636184553afd8b33b98d320a1 (patch) | |
tree | c2bca49295ed40948af4f7750986ffd71b61d111 /builtin-receive-pack.c | |
parent | e169b974593c27ba7a0d7f63ec0ec40373cb64bb (diff) | |
download | git-0077138cd9d4f94636184553afd8b33b98d320a1.tar.gz |
Simplify some instances of run_command() by using run_command_v_opt().
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-receive-pack.c')
-rw-r--r-- | builtin-receive-pack.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/builtin-receive-pack.c b/builtin-receive-pack.c index 0b08da9b59..33d345dc39 100644 --- a/builtin-receive-pack.c +++ b/builtin-receive-pack.c @@ -192,7 +192,6 @@ static int run_receive_hook(const char *hook_name) static int run_update_hook(struct command *cmd) { static const char update_hook[] = "hooks/update"; - struct child_process proc; const char *argv[5]; if (access(update_hook, X_OK) < 0) @@ -204,12 +203,9 @@ static int run_update_hook(struct command *cmd) argv[3] = sha1_to_hex(cmd->new_sha1); argv[4] = NULL; - memset(&proc, 0, sizeof(proc)); - proc.argv = argv; - proc.no_stdin = 1; - proc.stdout_to_stderr = 1; - - return hook_status(run_command(&proc), update_hook); + return hook_status(run_command_v_opt(argv, RUN_COMMAND_NO_STDIN | + RUN_COMMAND_STDOUT_TO_STDERR), + update_hook); } static int is_ref_checked_out(const char *ref) |