git-cherry-pick: add allow-empty option
[gitweb.git] / sequencer.c
index a37846a594f5a2d6acfb075ece1b5c30dda2329f..71929ba8cdeb45dc4a05a6513ac72b90dacf32be 100644 (file)
@@ -260,8 +260,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
  */
 static int run_git_commit(const char *defmsg, struct replay_opts *opts)
 {
-       /* 6 is max possible length of our args array including NULL */
-       const char *args[6];
+       /* 7 is max possible length of our args array including NULL */
+       const char *args[7];
        int i = 0;
 
        args[i++] = "commit";
@@ -272,6 +272,9 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts)
                args[i++] = "-F";
                args[i++] = defmsg;
        }
+       if (opts->allow_empty)
+               args[i++] = "--allow-empty";
+
        args[i] = NULL;
 
        return run_command_v_opt(args, RUN_GIT_CMD);