cherry-pick: add --allow-empty-message option

Scripts such as "git rebase -i" cannot currently cherry-pick commits
which have an empty commit message, as git cherry-pick calls git
commit without the --allow-empty-message option.

Add an --allow-empty-message option to git cherry-pick which is passed
through to git commit, so this behaviour can be overridden.

Signed-off-by: Chris Webb <chris@arachsys.com>
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Chris Webb
2012-08-02 11:38:51 +01:00
committed by Junio C Hamano
parent 3fe4498197
commit 4bee958479
5 changed files with 16 additions and 0 deletions

View File

@ -311,6 +311,9 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
if (allow_empty)
argv_array_push(&array, "--allow-empty");
if (opts->allow_empty_message)
argv_array_push(&array, "--allow-empty-message");
rc = run_command_v_opt(array.argv, RUN_GIT_CMD);
argv_array_clear(&array);
return rc;