]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/helper/test-fake-ssh.c
Merge branch 'ab/various-leak-fixes'
[thirdparty/git.git] / t / helper / test-fake-ssh.c
index d5e511633ab9a7fbb1b06fc38b2e2127da8f40bd..27323cb3672c35152e83e8741585a6c9520159f0 100644 (file)
@@ -8,7 +8,7 @@ int cmd_main(int argc, const char **argv)
        struct strbuf buf = STRBUF_INIT;
        FILE *f;
        int i;
-       const char *child_argv[] = { NULL, NULL };
+       struct child_process cmd = CHILD_PROCESS_INIT;
 
        /* First, print all parameters into $TRASH_DIRECTORY/ssh-output */
        if (!trash_directory)
@@ -26,6 +26,7 @@ int cmd_main(int argc, const char **argv)
        /* Now, evaluate the *last* parameter */
        if (argc < 2)
                return 0;
-       child_argv[0] = argv[argc - 1];
-       return run_command_v_opt(child_argv, RUN_USING_SHELL);
+       cmd.use_shell = 1;
+       strvec_push(&cmd.args, argv[argc - 1]);
+       return run_command(&cmd);
 }