Skip to content

Commit 2fb0e14

Browse files
chriscoolgitster
authored andcommitted
revert: use run_command_v_opt() instead of execv_git_cmd()
This is needed by the following commits, because we are going to cherry pick many commits instead of just one. Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 831244b commit 2fb0e14

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

builtin/revert.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
508508
}
509509
}
510510

511+
free_message(&msg);
512+
511513
/*
512514
*
513515
* If we are cherry-pick, and if the merge did not result in
@@ -520,7 +522,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)
520522
if (!no_commit) {
521523
/* 6 is max possible length of our args array including NULL */
522524
const char *args[6];
525+
int res;
523526
int i = 0;
527+
524528
args[i++] = "commit";
525529
args[i++] = "-n";
526530
if (signoff)
@@ -530,9 +534,12 @@ static int revert_or_cherry_pick(int argc, const char **argv)
530534
args[i++] = defmsg;
531535
}
532536
args[i] = NULL;
533-
return execv_git_cmd(args);
537+
res = run_command_v_opt(args, RUN_GIT_CMD);
538+
free(defmsg);
539+
540+
return res;
534541
}
535-
free_message(&msg);
542+
536543
free(defmsg);
537544

538545
return 0;

0 commit comments

Comments
 (0)