]> 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 93bec62afa993cb236ce09c13b38932ee396f250..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) {
@@ -2301,7 +2299,7 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
        return 0;
 }
 
-static int git_am_config(const char *k, const char *v, void *cb)
+static int git_am_config(const char *k, const char *v, void *cb UNUSED)
 {
        int status;