summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2010-06-02 07:58:35 +0200
committerJunio C Hamano <gitster@pobox.com>2010-06-02 10:09:41 -0700
commit2fb0e14f4014a4f5027401bc7156929309449726 (patch)
tree75ec6499d8638574084c077f3d608f606a267e92
parent831244bd0df6871c618fc8becbb5c0f1fb8f5459 (diff)
downloadgit-2fb0e14f4014a4f5027401bc7156929309449726.tar.gz
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>
-rw-r--r--builtin/revert.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index 5df0d690d9..02f18c2208 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -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
@@ -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)
@@ -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;