59
" git commit --allow-empty\n"
60
"\n");
61
62
+static const char empty_rebase_pick_advice[] =
63
+N_("Otherwise, please use 'git rebase --skip'\n");
64
+
65
static const char empty_cherry_pick_advice_single[] =
66
N_("Otherwise, please use 'git cherry-pick --skip'\n");
67
452
die(_("cannot do a partial commit during a merge."));
453
else if (is_from_cherry_pick(whence))
454
die(_("cannot do a partial commit during a cherry-pick."));
455
+ else if (is_from_rebase(whence))
456
+ die(_("cannot do a partial commit during a rebase."));
457
}
458
459
if (list_paths(&partial, !current_head ? NULL : "HEAD", &pathspec))
770
*/
771
else if (whence == FROM_MERGE)
772
hook_arg1 = "merge";
768
- else if (is_from_cherry_pick(whence)) {
773
+ else if (is_from_cherry_pick(whence) || whence == FROM_REBASE_PICK) {
774
hook_arg1 = "commit";
775
hook_arg2 = "CHERRY_PICK_HEAD";
776
}
947
run_status(stdout, index_file, prefix, 0, s);
948
if (amend)
949
fputs(_(empty_amend_advice), stderr);
945
- else if (is_from_cherry_pick(whence)) {
950
+ else if (is_from_cherry_pick(whence) ||
951
+ whence == FROM_REBASE_PICK) {
952
fputs(_(empty_cherry_pick_advice), stderr);
953
if (whence == FROM_CHERRY_PICK_SINGLE)
954
fputs(_(empty_cherry_pick_advice_single), stderr);
949
- else
955
+ else if (whence == FROM_CHERRY_PICK_MULTI)
956
fputs(_(empty_cherry_pick_advice_multi), stderr);
957
+ else
958
+ fputs(_(empty_rebase_pick_advice), stderr);
959
}
960
return 0;
961
}
1160
die(_("You are in the middle of a merge -- cannot amend."));
1161
else if (is_from_cherry_pick(whence))
1162
die(_("You are in the middle of a cherry-pick -- cannot amend."));
1163
+ else if (whence == FROM_REBASE_PICK)
1164
+ die(_("You are in the middle of a rebase -- cannot amend."));
1165
}
1166
if (fixup_message && squash_message)
1167
die(_("Options --squash and --fixup cannot be used together"));
1183
use_message = edit_message;
1184
if (amend && !use_message && !fixup_message)
1185
use_message = "HEAD";
1176
- if (!use_message && !is_from_cherry_pick(whence) && renew_authorship)
1186
+ if (!use_message && !is_from_cherry_pick(whence) &&
1187
+ !is_from_rebase(whence) && renew_authorship)
1188
die(_("--reset-author can be used only with -C, -c or --amend."));
1189
if (use_message) {
1190
use_message_buffer = read_commit_message(use_message);
1193
author_message_buffer = use_message_buffer;
1194
}
1195
}
1185
- if (is_from_cherry_pick(whence) && !renew_authorship) {
1196
+ if ((is_from_cherry_pick(whence) || whence == FROM_REBASE_PICK) &&
1197
+ !renew_authorship) {
1198
author_message = "CHERRY_PICK_HEAD";
1199
author_message_buffer = read_commit_message(author_message);
1200
}
1614
if (!reflog_msg)
1615
reflog_msg = is_from_cherry_pick(whence)
1616
? "commit (cherry-pick)"
1617
+ : is_from_rebase(whence)
1618
+ ? "commit (rebase)"
1619
: "commit";
1620
commit_list_insert(current_head, &parents);
1621
}