Skip to content

Commit 38c93c4

Browse files
newrengitster
authored andcommitted
t4200: demonstrate rerere segfault on specially crafted merge
Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fc54c1a commit 38c93c4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

t/t4200-rerere.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,33 @@ test_expect_success 'multiple identical conflicts' '
580580
count_pre_post 0 0
581581
'
582582

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+
583612
test_done

0 commit comments

Comments
 (0)