t4200: demonstrate rerere segfault on specially crafted merge
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Sep 11, 2018 at 11:55 UTC
38c93c4d9d11b881697229d15420fc5c1367d7a9
1 file changed
+29
t/t4200-rerere.sh
+29
@@ -580,4 +580,33 @@ test_expect_success 'multiple identical conflicts' '
580
count_pre_post 0 0
581
'
582
583
+test_expect_success 'setup simple stage 1 handling' '
584
+ test_create_repo stage_1_handling &&
585
+ (
586
+ cd stage_1_handling &&
587
+
588
+ test_seq 1 10 >original &&
589
+ git add original &&
590
+ git commit -m original &&
591
+
592
+ git checkout -b A master &&
593
+ git mv original A &&
594
+ git commit -m "rename to A" &&
595
+
596
+ git checkout -b B master &&
597
+ git mv original B &&
598
+ git commit -m "rename to B"
599
+ )
600
+'
601
+
602
+test_expect_failure 'test simple stage 1 handling' '
603
+ (
604
+ cd stage_1_handling &&
605
+
606
+ git config rerere.enabled true &&
607
+ git checkout A^0 &&
608
+ test_must_fail git merge B^0
609
+ )
610
+'
611
+
612
test_done