| 516 | "\"git rebase --abort\"."); |
| 517 | |
| 518 | static void print_advice(struct repository *r, int show_hint, |
| 519 | struct replay_opts *opts) |
| 520 | { |
| 521 | const char *msg; |
| 522 | |
| 523 | if (is_rebase_i(opts)) |
| 524 | msg = rebase_resolvemsg; |
| 525 | else |
| 526 | msg = getenv("GIT_CHERRY_PICK_HELP"); |
| 527 | |
| 528 | if (msg) { |
| 529 | advise_if_enabled(ADVICE_MERGE_CONFLICT, "%s", msg); |
| 530 | /* |
| 531 | * A conflict has occurred but the porcelain |
| 532 | * (typically rebase --interactive) wants to take care |
| 533 | * of the commit itself so remove CHERRY_PICK_HEAD |
| 534 | */ |
| 535 | refs_delete_ref(get_main_ref_store(r), "", "CHERRY_PICK_HEAD", |
| 536 | NULL, REF_NO_DEREF); |
| 537 | return; |
| 538 | } |
| 539 | |
| 540 | if (show_hint) { |
| 541 | if (opts->no_commit) |
| 542 | advise_if_enabled(ADVICE_MERGE_CONFLICT, |
| 543 | _("after resolving the conflicts, mark the corrected paths\n" |
| 544 | "with 'git add <paths>' or 'git rm <paths>'")); |
| 545 | else if (opts->action == REPLAY_PICK) |
| 546 | advise_if_enabled(ADVICE_MERGE_CONFLICT, |
| 547 | _("After resolving the conflicts, mark them with\n" |
| 548 | "\"git add/rm <pathspec>\", then run\n" |
| 549 | "\"git cherry-pick --continue\".\n" |
| 550 | "You can instead skip this commit with \"git cherry-pick --skip\".\n" |
| 551 | "To abort and get back to the state before \"git cherry-pick\",\n" |
| 552 | "run \"git cherry-pick --abort\".")); |
| 553 | else if (opts->action == REPLAY_REVERT) |
| 554 | advise_if_enabled(ADVICE_MERGE_CONFLICT, |
| 555 | _("After resolving the conflicts, mark them with\n" |
| 556 | "\"git add/rm <pathspec>\", then run\n" |
| 557 | "\"git revert --continue\".\n" |
| 558 | "You can instead skip this commit with \"git revert --skip\".\n" |
| 559 | "To abort and get back to the state before \"git revert\",\n" |
| 560 | "run \"git revert --abort\".")); |
| 561 | else |
| 562 | BUG("unexpected pick action in print_advice()"); |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | static int write_message(const void *buf, size_t len, const char *filename, |
| 567 | int append_eol) |
no test coverage detected