]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/am.c
replace and remove run_command_v_opt()
[thirdparty/git.git] / builtin / am.c
index 39fea24833078be76d76d974e5b601715ed51aea..20aea0d2487b2dfe851d44f753e7de7439698223 100644 (file)
@@ -2187,14 +2187,12 @@ static int show_patch(struct am_state *state, enum show_patch_type sub_mode)
        int len;
 
        if (!is_null_oid(&state->orig_commit)) {
-               const char *av[4] = { "show", NULL, "--", NULL };
-               char *new_oid_str;
-               int ret;
+               struct child_process cmd = CHILD_PROCESS_INIT;
 
-               av[1] = new_oid_str = xstrdup(oid_to_hex(&state->orig_commit));
-               ret = run_command_v_opt(av, RUN_GIT_CMD);
-               free(new_oid_str);
-               return ret;
+               strvec_pushl(&cmd.args, "show", oid_to_hex(&state->orig_commit),
+                            "--", NULL);
+               cmd.git_cmd = 1;
+               return run_command(&cmd);
        }
 
        switch (sub_mode) {