File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -521,7 +521,7 @@ static int check_one_conflict(int i, int *type)
521
521
}
522
522
523
523
* type = PUNTED ;
524
- while (ce_stage (active_cache [i ]) == 1 )
524
+ while (i < active_nr && ce_stage (active_cache [i ]) == 1 )
525
525
i ++ ;
526
526
527
527
/* Only handle regular files with both stages #2 and #3 */
Original file line number Diff line number Diff line change @@ -642,4 +642,33 @@ test_expect_success 'rerere with inner conflict markers' '
642
642
test_cmp expect actual
643
643
'
644
644
645
+ test_expect_success ' setup simple stage 1 handling' '
646
+ test_create_repo stage_1_handling &&
647
+ (
648
+ cd stage_1_handling &&
649
+
650
+ test_seq 1 10 >original &&
651
+ git add original &&
652
+ git commit -m original &&
653
+
654
+ git checkout -b A master &&
655
+ git mv original A &&
656
+ git commit -m "rename to A" &&
657
+
658
+ git checkout -b B master &&
659
+ git mv original B &&
660
+ git commit -m "rename to B"
661
+ )
662
+ '
663
+
664
+ test_expect_success ' test simple stage 1 handling' '
665
+ (
666
+ cd stage_1_handling &&
667
+
668
+ git config rerere.enabled true &&
669
+ git checkout A^0 &&
670
+ test_must_fail git merge B^0
671
+ )
672
+ '
673
+
645
674
test_done
You can’t perform that action at this time.
0 commit comments