diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-22 10:59:36 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-22 10:59:37 -0700 |
commit | 12621cb22224d1c2f507a643a578e386ee891c5c (patch) | |
tree | d0ab888b37baa09db9c7ef74840b739ff3cafb09 /run-command.c | |
parent | Merge branch 'nd/path-max-must-go' (diff) | |
parent | remote-testsvn: use internal argv_array of struct child_process in cmd_import() (diff) | |
download | tgif-12621cb22224d1c2f507a643a578e386ee891c5c.tar.xz |
Merge branch 'rs/code-cleaning'
* rs/code-cleaning:
remote-testsvn: use internal argv_array of struct child_process in cmd_import()
bundle: use internal argv_array of struct child_process in create_bundle()
fast-import: use hashcmp() for SHA1 hash comparison
transport: simplify fetch_objs_via_rsync() using argv_array
run-command: use internal argv_array of struct child_process in run_hook_ve()
use commit_list_count() to count the members of commit_lists
strbuf: use strbuf_addstr() for adding C strings
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/run-command.c b/run-command.c index be07d4ad33..576dfeaa3f 100644 --- a/run-command.c +++ b/run-command.c @@ -770,28 +770,21 @@ char *find_hook(const char *name) int run_hook_ve(const char *const *env, const char *name, va_list args) { struct child_process hook; - struct argv_array argv = ARGV_ARRAY_INIT; const char *p; - int ret; p = find_hook(name); if (!p) return 0; - argv_array_push(&argv, p); - - while ((p = va_arg(args, const char *))) - argv_array_push(&argv, p); - memset(&hook, 0, sizeof(hook)); - hook.argv = argv.argv; + argv_array_push(&hook.args, p); + while ((p = va_arg(args, const char *))) + argv_array_push(&hook.args, p); hook.env = env; hook.no_stdin = 1; hook.stdout_to_stderr = 1; - ret = run_command(&hook); - argv_array_clear(&argv); - return ret; + return run_command(&hook); } int run_hook_le(const char *const *env, const char *name, ...) |