Skip to content

Commit f826fb7

Browse files
phillipwoodgitster
authored andcommitted
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>
1 parent 8d8cb4b commit f826fb7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

builtin/revert.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
155155
"--strategy-option", opts->xopts ? 1 : 0,
156156
"-x", opts->record_origin,
157157
"--ff", opts->allow_ff,
158+
"--rerere-autoupdate", opts->allow_rerere_auto == RERERE_AUTOUPDATE,
159+
"--no-rerere-autoupdate", opts->allow_rerere_auto == RERERE_NOAUTOUPDATE,
158160
NULL);
159161
}
160162

t/t3504-cherry-pick-rerere.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
6565
git reset --hard bar-dev
6666
'
6767

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+
6881
test_expect_success 'cherry-pick --rerere-autoupdate more than once' '
6982
test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-master &&
7083
test_cmp foo-expect foo &&

0 commit comments

Comments
 (0)