Skip to content

Commit

Permalink
revert: use run_command_v_opt() instead of execv_git_cmd()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Jun 2, 2010
1 parent 831244b commit 2fb0e14
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions builtin/revert.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
}
}

free_message(&msg);

/*
*
* If we are cherry-pick, and if the merge did not result in
Expand All @@ -520,7 +522,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)
if (!no_commit) {
/* 6 is max possible length of our args array including NULL */
const char *args[6];
int res;
int i = 0;

args[i++] = "commit";
args[i++] = "-n";
if (signoff)
Expand All @@ -530,9 +534,12 @@ static int revert_or_cherry_pick(int argc, const char **argv)
args[i++] = defmsg;
}
args[i] = NULL;
return execv_git_cmd(args);
res = run_command_v_opt(args, RUN_GIT_CMD);
free(defmsg);

return res;
}
free_message(&msg);

free(defmsg);

return 0;
Expand Down

0 comments on commit 2fb0e14

Please sign in to comment.