cherry-pick: demonstrate option amnesia
When cherry-pick stops for a conflict resolution it forgets --allow-empty --allow-empty-message and --keep-redundant-commits. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Phillip Wood committed
Mar 13, 2019 at 18:26 UTC
36b0503a19c777b57805aa26aabd77f99dbf91b7
1 file changed
+24
t/t3507-cherry-pick-conflict.sh
+24
@@ -25,6 +25,11 @@ test_expect_success setup '
25
test_commit base foo b &&
26
test_commit picked foo c &&
27
test_commit --signoff picked-signed foo d &&
28
+ git checkout -b topic initial &&
29
+ test_commit redundant-pick foo c redundant &&
30
+ git commit --allow-empty --allow-empty-message &&
31
+ git tag empty &&
32
+ git checkout master &&
33
git config advice.detachedhead false
34
35
'
@@ -405,4 +410,23 @@ test_expect_success 'cherry-pick preserves sparse-checkout' '
410
test_i18ngrep ! "Changes not staged for commit:" actual
411
'
412
413
+test_expect_failure 'cherry-pick --continue remembers --keep-redundant-commits' '
414
+ test_when_finished "git cherry-pick --abort || :" &&
415
+ pristine_detach initial &&
416
+ test_must_fail git cherry-pick --keep-redundant-commits picked redundant &&
417
+ echo c >foo &&
418
+ git add foo &&
419
+ git cherry-pick --continue
420
+'
421
+
422
+test_expect_failure 'cherry-pick --continue remembers --allow-empty and --allow-empty-message' '
423
+ test_when_finished "git cherry-pick --abort || :" &&
424
+ pristine_detach initial &&
425
+ test_must_fail git cherry-pick --allow-empty --allow-empty-message \
426
+ picked empty &&
427
+ echo c >foo &&
428
+ git add foo &&
429
+ git cherry-pick --continue
430
+'
431
+
432
test_done