cherry-pick/revert: reject --rerere-autoupdate when continuing

cherry-pick and revert should not accept --[no-]rerere-autoupdate once they have started. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Phillip Wood committed Aug 2, 2017 at 11:44 UTC f826fb799ed06f2f9537466f6988bcabd1200ebd
2 files changed +15
builtin/revert.c
+2
@@ -155,6 +155,8 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
155 "--strategy-option", opts->xopts ? 1 : 0,
156 "-x", opts->record_origin,
157 "--ff", opts->allow_ff,
158 + "--rerere-autoupdate", opts->allow_rerere_auto == RERERE_AUTOUPDATE,
159 + "--no-rerere-autoupdate", opts->allow_rerere_auto == RERERE_NOAUTOUPDATE,
160 NULL);
161 }
162
t/t3504-cherry-pick-rerere.sh
+13
@@ -65,6 +65,19 @@ test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
65 git reset --hard bar-dev
66 '
67
68 +test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
69 + test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
70 + test_cmp foo-expect foo &&
71 + git diff-files --quiet &&
72 + test_must_fail git cherry-pick --continue --rerere-autoupdate >actual 2>&1 &&
73 + echo "fatal: cherry-pick: --rerere-autoupdate cannot be used with --continue" >expect &&
74 + test_i18ncmp expect actual &&
75 + test_must_fail git cherry-pick --continue --no-rerere-autoupdate >actual 2>&1 &&
76 + echo "fatal: cherry-pick: --no-rerere-autoupdate cannot be used with --continue" >expect &&
77 + test_i18ncmp expect actual &&
78 + git cherry-pick --abort
79 +'
80 +
81 test_expect_success 'cherry-pick --rerere-autoupdate more than once' '
82 test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-master &&
83 test_cmp foo-expect foo &&