MCPcopy Create free account
hub / github.com/git/git / check_merge_commit_insn

Function check_merge_commit_insn

sequencer.c:2658–2711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2656}
2657
2658static int check_merge_commit_insn(enum todo_command command)
2659{
2660 switch(command) {
2661 case TODO_PICK:
2662 error(_("'%s' does not accept merge commits"),
2663 todo_command_info[command].str);
2664 advise_if_enabled(ADVICE_REBASE_TODO_ERROR, _(
2665 /*
2666 * TRANSLATORS: 'pick' and 'merge -C' should not be
2667 * translated.
2668 */
2669 "'pick' does not take a merge commit. If you wanted to\n"
2670 "replay the merge, use 'merge -C' on the commit."));
2671 return -1;
2672
2673 case TODO_REWORD:
2674 error(_("'%s' does not accept merge commits"),
2675 todo_command_info[command].str);
2676 advise_if_enabled(ADVICE_REBASE_TODO_ERROR, _(
2677 /*
2678 * TRANSLATORS: 'reword' and 'merge -c' should not be
2679 * translated.
2680 */
2681 "'reword' does not take a merge commit. If you wanted to\n"
2682 "replay the merge and reword the commit message, use\n"
2683 "'merge -c' on the commit"));
2684 return -1;
2685
2686 case TODO_EDIT:
2687 error(_("'%s' does not accept merge commits"),
2688 todo_command_info[command].str);
2689 advise_if_enabled(ADVICE_REBASE_TODO_ERROR, _(
2690 /*
2691 * TRANSLATORS: 'edit', 'merge -C' and 'break' should
2692 * not be translated.
2693 */
2694 "'edit' does not take a merge commit. If you wanted to\n"
2695 "replay the merge, use 'merge -C' on the commit, and then\n"
2696 "'break' to give the control back to you so that you can\n"
2697 "do 'git commit --amend && git rebase --continue'."));
2698 return -1;
2699
2700 case TODO_FIXUP:
2701 case TODO_SQUASH:
2702 return error(_("cannot squash merge commit into another commit"));
2703
2704 case TODO_MERGE:
2705 case TODO_DROP:
2706 return 0;
2707
2708 default:
2709 BUG("unexpected todo_command");
2710 }
2711}
2712
2713static int parse_insn_line(struct repository *r, struct replay_opts *opts,
2714 struct todo_item *item, const char *buf,

Callers 1

parse_insn_lineFunction · 0.85

Calls 2

errorFunction · 0.85
advise_if_enabledFunction · 0.85

Tested by

no test coverage detected