@matheusbsbs / matheus-bagliano / commits / 2fb0e14f40
Fork 0

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 <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Jun 2, 2010 at 07:58 UTC 2fb0e14f4014a4f5027401bc7156929309449726
1 file changed +9 -2
builtin/revert.c
+9 -2
@@ -508,6 +508,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
508 }
509 }
510
511 + free_message(&msg);
512 +
513 /*
514 *
515 * 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)
522 if (!no_commit) {
523 /* 6 is max possible length of our args array including NULL */
524 const char *args[6];
525 + int res;
526 int i = 0;
527 +
528 args[i++] = "commit";
529 args[i++] = "-n";
530 if (signoff)
@@ -530,9 +534,12 @@ static int revert_or_cherry_pick(int argc, const char **argv)
534 args[i++] = defmsg;
535 }
536 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;
541 }
535 - free_message(&msg);
542 +
543 free(defmsg);
544
545 return 0;