summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2022-10-30 11:55:06 (GMT)
committerTaylor Blau <me@ttaylorr.com>2022-10-30 18:04:51 (GMT)
commitddbb47fde9b6d8cd9f3728847a378f634318cfb1 (patch)
treeef093554b4ce4914edb7a0a0ace39187347bb344 /t/helper
parentef249b398e26dd76f473ce83a35219c520f6fdbe (diff)
downloadgit-ddbb47fde9b6d8cd9f3728847a378f634318cfb1.zip
git-ddbb47fde9b6d8cd9f3728847a378f634318cfb1.tar.gz
git-ddbb47fde9b6d8cd9f3728847a378f634318cfb1.tar.bz2
replace and remove run_command_v_opt()
Replace the remaining calls of run_command_v_opt() with run_command() calls and explict struct child_process variables. This is more verbose, but not by much overall. The code becomes more flexible, e.g. it's easy to extend to conditionally add a new argument. Then remove the now unused function and its own flag names, simplifying the run-command API. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-trace2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/helper/test-trace2.c b/t/helper/test-trace2.c
index a714130..94fd8cc 100644
--- a/t/helper/test-trace2.c
+++ b/t/helper/test-trace2.c
@@ -132,6 +132,7 @@ static int ut_003error(int argc, const char **argv)
*/
static int ut_004child(int argc, const char **argv)
{
+ struct child_process cmd = CHILD_PROCESS_INIT;
int result;
/*
@@ -141,7 +142,8 @@ static int ut_004child(int argc, const char **argv)
if (!argc)
return 0;
- result = run_command_v_opt(argv, 0);
+ strvec_pushv(&cmd.args, argv);
+ result = run_command(&cmd);
exit(result);
}