diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-12-15 17:39:47 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-15 17:39:47 (GMT) |
commit | 832ec72c3e15820c3b728b3a56398655d7bb7cb3 (patch) | |
tree | e2139982bd0e26cf3434a3e4edbc3d03ec44ec10 /sequencer.c | |
parent | 9c5bef3b358b12b9af5d54014f4efc62588f5df1 (diff) | |
parent | c7c4bdeccf3e737e6e674cd9f0828922e629ab06 (diff) | |
download | git-832ec72c3e15820c3b728b3a56398655d7bb7cb3.zip git-832ec72c3e15820c3b728b3a56398655d7bb7cb3.tar.gz git-832ec72c3e15820c3b728b3a56398655d7bb7cb3.tar.bz2 |
Merge branch 'ab/run-command'
API clean-up.
* ab/run-command:
run-command API: remove "env" member, always use "env_array"
difftool: use "env_array" to simplify memory management
run-command API: remove "argv" member, always use "args"
run-command API users: use strvec_push(), not argv construction
run-command API users: use strvec_pushl(), not argv construction
run-command tests: use strvec_pushv(), not argv assignment
run-command API users: use strvec_pushv(), not argv assignment
upload-archive: use regular "struct child_process" pattern
worktree: stop being overly intimate with run_command() internals
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sequencer.c b/sequencer.c index 795b370..b69ef4d 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1164,18 +1164,14 @@ static int run_rewrite_hook(const struct object_id *oldoid, const struct object_id *newoid) { struct child_process proc = CHILD_PROCESS_INIT; - const char *argv[3]; int code; struct strbuf sb = STRBUF_INIT; + const char *hook_path = find_hook("post-rewrite"); - argv[0] = find_hook("post-rewrite"); - if (!argv[0]) + if (!hook_path) return 0; - argv[1] = "amend"; - argv[2] = NULL; - - proc.argv = argv; + strvec_pushl(&proc.args, hook_path, "amend", NULL); proc.in = -1; proc.stdout_to_stderr = 1; proc.trace2_hook_name = "post-rewrite"; |