summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7b53b92)
raw | patch | inline | side by side (parent: 7b53b92)
author | Christian Couder <chriscool@tuxfamily.org> | |
Tue, 13 Jul 2010 23:28:13 +0000 (01:28 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 16 Jul 2010 22:21:52 +0000 (15:21 -0700) |
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/revert.c | patch | blob | history |
diff --git a/builtin/revert.c b/builtin/revert.c
index b082bb425c6e865a3e5d7bae00b9da68e0933517..b84b5b8645dce4fee190e7b11a5ac8ec24a994fc 100644 (file)
--- a/builtin/revert.c
+++ b/builtin/revert.c
return !clean;
}
+/*
+ * If we are cherry-pick, and if the merge did not result in
+ * hand-editing, we will hit this commit and inherit the original
+ * author date and name.
+ * If we are revert, or if our cherry-pick results in a hand merge,
+ * we had better say that the current user is responsible for that.
+ */
+static int run_git_commit(const char *defmsg)
+{
+ /* 6 is max possible length of our args array including NULL */
+ const char *args[6];
+ int i = 0;
+
+ args[i++] = "commit";
+ args[i++] = "-n";
+ if (signoff)
+ args[i++] = "-s";
+ if (!edit) {
+ args[i++] = "-F";
+ args[i++] = defmsg;
+ }
+ args[i] = NULL;
+
+ return run_command_v_opt(args, RUN_GIT_CMD);
+}
+
static int do_pick_commit(void)
{
unsigned char head[20];
if (res)
return 1;
- /*
- *
- * If we are cherry-pick, and if the merge did not result in
- * hand-editing, we will hit this commit and inherit the original
- * author date and name.
- * If we are revert, or if our cherry-pick results in a hand merge,
- * we had better say that the current user is responsible for that.
- */
-
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)
- args[i++] = "-s";
- if (!edit) {
- args[i++] = "-F";
- args[i++] = defmsg;
- }
- args[i] = NULL;
- res = run_command_v_opt(args, RUN_GIT_CMD);
+ res = run_git_commit(defmsg);
free(defmsg);
-
return res;
}