diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-12-15 09:39:47 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-15 09:39:47 -0800 |
commit | 832ec72c3e15820c3b728b3a56398655d7bb7cb3 (patch) | |
tree | e2139982bd0e26cf3434a3e4edbc3d03ec44ec10 /builtin/upload-archive.c | |
parent | Merge branch 'hn/t1404-df-limitation-is-ref-files-only' (diff) | |
parent | run-command API: remove "env" member, always use "env_array" (diff) | |
download | tgif-832ec72c3e15820c3b728b3a56398655d7bb7cb3.tar.xz |
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 'builtin/upload-archive.c')
-rw-r--r-- | builtin/upload-archive.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c index 24654b4c9b..98d028dae6 100644 --- a/builtin/upload-archive.c +++ b/builtin/upload-archive.c @@ -77,7 +77,7 @@ static ssize_t process_input(int child_fd, int band) int cmd_upload_archive(int argc, const char **argv, const char *prefix) { - struct child_process writer = { argv }; + struct child_process writer = CHILD_PROCESS_INIT; if (argc == 2 && !strcmp(argv[1], "-h")) usage(upload_archive_usage); @@ -89,9 +89,10 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix) * multiplexed out to our fd#1. If the child dies, we tell the other * end over channel #3. */ - argv[0] = "upload-archive--writer"; writer.out = writer.err = -1; writer.git_cmd = 1; + strvec_push(&writer.args, "upload-archive--writer"); + strvec_pushv(&writer.args, argv + 1); if (start_command(&writer)) { int err = errno; packet_write_fmt(1, "NACK unable to spawn subprocess\n"); |