Commit a27f31d8f54635e349d5c64df4394a3f51752a5a

Carlos Martín Nieto 2015-11-30T04:49:31

Merge pull request #3513 from ethomson/merge_recursive Recursive Merge

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d5a416..196ad70 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,14 @@ v0.23 + 1
 
 ### Breaking API changes
 
+* The `git_merge_tree_flag_t` is now `git_merge_flag_t`.  Subsequently,
+  its members are no longer prefixed with `GIT_MERGE_TREE_FLAG` but are
+  now prefixed with `GIT_MERGE_FLAG`, and the `tree_flags` field of the
+  `git_merge_options` structure is now named `flags`.
+
+* The `git_merge_file_flags_t` enum is now `git_merge_file_flag_t` for
+  consistency with other enum type names.
+
 * `git_cert` descendent types now have a proper `parent` member
 
 * It is the responsibility of the refdb backend to decide what to do
diff --git a/include/git2/merge.h b/include/git2/merge.h
index b7da63e..af53ead 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -62,8 +62,8 @@ GIT_EXTERN(int) git_merge_file_init_input(
 	unsigned int version);
 
 /**
- * Flags for `git_merge_tree` options.  A combination of these flags can be
- * passed in via the `tree_flags` value in the `git_merge_options`.
+ * Flags for `git_merge` options.  A combination of these flags can be
+ * passed in via the `flags` value in the `git_merge_options`.
  */
 typedef enum {
 	/**
@@ -71,20 +71,28 @@ typedef enum {
 	 * side or the common ancestor and the "theirs" side.  This will enable
 	 * the ability to merge between a modified and renamed file.
 	 */
-	GIT_MERGE_TREE_FIND_RENAMES = (1 << 0),
+	GIT_MERGE_FIND_RENAMES = (1 << 0),
 
 	/**
 	 * If a conflict occurs, exit immediately instead of attempting to
 	 * continue resolving conflicts.  The merge operation will fail with
 	 * GIT_EMERGECONFLICT and no index will be returned.
 	 */
-	GIT_MERGE_TREE_FAIL_ON_CONFLICT = (1 << 1),
+	GIT_MERGE_FAIL_ON_CONFLICT = (1 << 1),
 
 	/**
 	 * Do not write the REUC extension on the generated index
 	 */
-	GIT_MERGE_TREE_SKIP_REUC = (1 << 2),
-} git_merge_tree_flag_t;
+	GIT_MERGE_SKIP_REUC = (1 << 2),
+
+	/**
+	 * If the commits being merged have multiple merge bases, do not build
+	 * a recursive merge base (by merging the multiple merge bases),
+	 * instead simply use the first base.  This flag provides a similar
+	 * merge base to `git-merge-resolve`.
+	 */
+	GIT_MERGE_NO_RECURSIVE = (1 << 3),
+} git_merge_flag_t;
 
 /**
  * Merge file favor options for `git_merge_options` instruct the file-level
@@ -152,7 +160,7 @@ typedef enum {
 
 	/** Take extra time to find minimal diff */
 	GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7),
-} git_merge_file_flags_t;
+} git_merge_file_flag_t;
 
 /**
  * Options for merging a file
@@ -181,8 +189,8 @@ typedef struct {
 	/** The file to favor in region conflicts. */
 	git_merge_file_favor_t favor;
 
-	/** see `git_merge_file_flags_t` above */
-	unsigned int flags;
+	/** see `git_merge_file_flag_t` above */
+	git_merge_file_flag_t flags;
 } git_merge_file_options;
 
 #define GIT_MERGE_FILE_OPTIONS_VERSION 1
@@ -232,11 +240,13 @@ typedef struct {
  */
 typedef struct {
 	unsigned int version;
-	git_merge_tree_flag_t tree_flags;
+
+	/** See `git_merge_flag_t` above */
+	git_merge_flag_t flags;
 
 	/**
 	 * Similarity to consider a file renamed (default 50).  If
-	 * `GIT_MERGE_TREE_FIND_RENAMES` is enabled, added files will be compared
+	 * `GIT_MERGE_FIND_RENAMES` is enabled, added files will be compared
 	 * with deleted files to determine their similarity.  Files that are
 	 * more similar than the rename threshold (percentage-wise) will be
 	 * treated as a rename.
@@ -255,11 +265,19 @@ typedef struct {
 	/** Pluggable similarity metric; pass NULL to use internal metric */
 	git_diff_similarity_metric *metric;
 
+	/**
+	 * Maximum number of times to merge common ancestors to build a
+	 * virtual merge base when faced with criss-cross merges.  When this
+	 * limit is reached, the next ancestor will simply be used instead of
+	 * attempting to merge it.  The default is unlimited.
+	 */
+	unsigned int recursion_limit;
+
 	/** Flags for handling conflicting content. */
 	git_merge_file_favor_t file_favor;
 
-	/** see `git_merge_file_flags_t` above */
-	unsigned int file_flags;
+	/** see `git_merge_file_flag_t` above */
+	git_merge_file_flag_t file_flags;
 } git_merge_options;
 
 #define GIT_MERGE_OPTIONS_VERSION 1
diff --git a/src/annotated_commit.c b/src/annotated_commit.c
index 3f2d2ed..e53b95d 100644
--- a/src/annotated_commit.c
+++ b/src/annotated_commit.c
@@ -7,12 +7,16 @@
 
 #include "common.h"
 #include "annotated_commit.h"
+#include "refs.h"
+#include "cache.h"
 
 #include "git2/commit.h"
 #include "git2/refs.h"
 #include "git2/repository.h"
 #include "git2/annotated_commit.h"
 #include "git2/revparse.h"
+#include "git2/tree.h"
+#include "git2/index.h"
 
 static int annotated_commit_init(
 	git_annotated_commit **out,
@@ -22,14 +26,17 @@ static int annotated_commit_init(
 	const char *remote_url)
 {
 	git_annotated_commit *annotated_commit;
+	git_commit *commit = NULL;
 	int error = 0;
 
 	assert(out && id);
 
 	*out = NULL;
 
-	annotated_commit = git__calloc(1, sizeof(git_annotated_commit));
-	GITERR_CHECK_ALLOC(annotated_commit);
+	if ((error = git_commit_lookup(&commit, repo, id)) < 0 ||
+		(error = git_annotated_commit_from_commit(&annotated_commit,
+			commit)) < 0)
+		goto done;
 
 	if (ref_name) {
 		annotated_commit->ref_name = git__strdup(ref_name);
@@ -41,15 +48,10 @@ static int annotated_commit_init(
 		GITERR_CHECK_ALLOC(annotated_commit->remote_url);
 	}
 
-	git_oid_fmt(annotated_commit->id_str, id);
-	annotated_commit->id_str[GIT_OID_HEXSZ] = '\0';
-
-	if ((error = git_commit_lookup(&annotated_commit->commit, repo, id)) < 0) {
-		git_annotated_commit_free(annotated_commit);
-		return error;
-	}
-
 	*out = annotated_commit;
+
+done:
+	git_commit_free(commit);
 	return error;
 }
 
@@ -75,6 +77,51 @@ int git_annotated_commit_from_ref(
 	return error;
 }
 
+int git_annotated_commit_from_head(
+	git_annotated_commit **out,
+	git_repository *repo)
+{
+	git_reference *head;
+	int error;
+
+	assert(out && repo);
+
+	*out = NULL;
+
+    if ((error = git_reference_lookup(&head, repo, GIT_HEAD_FILE)) < 0)
+		return -1;
+
+	error = git_annotated_commit_from_ref(out, repo, head);
+
+	git_reference_free(head);
+	return error;
+}
+
+int git_annotated_commit_from_commit(
+	git_annotated_commit **out,
+	git_commit *commit)
+{
+	git_annotated_commit *annotated_commit;
+
+	assert(out && commit);
+
+	*out = NULL;
+
+	annotated_commit = git__calloc(1, sizeof(git_annotated_commit));
+	GITERR_CHECK_ALLOC(annotated_commit);
+
+	annotated_commit->type = GIT_ANNOTATED_COMMIT_REAL;
+
+	git_cached_obj_incref(commit);
+	annotated_commit->commit = commit;
+
+	git_oid_fmt(annotated_commit->id_str, git_commit_id(commit));
+	annotated_commit->id_str[GIT_OID_HEXSZ] = '\0';
+
+	*out = annotated_commit;
+	return 0;
+}
+
 int git_annotated_commit_lookup(
 	git_annotated_commit **out,
 	git_repository *repo,
@@ -136,14 +183,20 @@ void git_annotated_commit_free(git_annotated_commit *annotated_commit)
 	if (annotated_commit == NULL)
 		return;
 
-	if (annotated_commit->commit != NULL)
-		git_commit_free(annotated_commit->commit);
-
-	if (annotated_commit->ref_name != NULL)
-		git__free(annotated_commit->ref_name);
-
-	if (annotated_commit->remote_url != NULL)
-		git__free(annotated_commit->remote_url);
+	switch (annotated_commit->type) {
+		case GIT_ANNOTATED_COMMIT_REAL:
+			git_commit_free(annotated_commit->commit);
+			git_tree_free(annotated_commit->tree);
+			git__free(annotated_commit->ref_name);
+			git__free(annotated_commit->remote_url);
+			break;
+		case GIT_ANNOTATED_COMMIT_VIRTUAL:
+			git_index_free(annotated_commit->index);
+			git_array_clear(annotated_commit->parents);
+			break;
+		default:
+			abort();
+	}
 
 	git__free(annotated_commit);
 }
diff --git a/src/annotated_commit.h b/src/annotated_commit.h
index e873184..cbb88fd 100644
--- a/src/annotated_commit.h
+++ b/src/annotated_commit.h
@@ -7,11 +7,31 @@
 #ifndef INCLUDE_annotated_commit_h__
 #define INCLUDE_annotated_commit_h__
 
+#include "oidarray.h"
+
 #include "git2/oid.h"
 
-/** Internal structure for merge inputs */
+typedef enum {
+	GIT_ANNOTATED_COMMIT_REAL = 1,
+	GIT_ANNOTATED_COMMIT_VIRTUAL = 2,
+} git_annotated_commit_t;
+
+/**
+ * Internal structure for merge inputs.  An annotated commit is generally
+ * "real" and backed by an actual commit in the repository, but merge will
+ * internally create "virtual" commits that are in-memory intermediate
+ * commits backed by an index.
+ */
 struct git_annotated_commit {
+	git_annotated_commit_t type;
+
+	/* real commit */
 	git_commit *commit;
+	git_tree *tree;
+
+	/* virtual commit structure */
+	git_index *index;
+	git_array_oid_t parents;
 
 	char *ref_name;
 	char *remote_url;
@@ -19,4 +39,9 @@ struct git_annotated_commit {
 	char id_str[GIT_OID_HEXSZ+1];
 };
 
+extern int git_annotated_commit_from_head(git_annotated_commit **out,
+	git_repository *repo);
+extern int git_annotated_commit_from_commit(git_annotated_commit **out,
+	git_commit *commit);
+
 #endif
diff --git a/src/merge.c b/src/merge.c
index bad5f95..9eb3b09 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "oidarray.h"
 #include "annotated_commit.h"
+#include "commit.h"
+#include "oidarray.h"
 
 #include "git2/types.h"
 #include "git2/repository.h"
@@ -47,6 +49,19 @@
 #define GIT_MERGE_INDEX_ENTRY_EXISTS(X)	((X).mode != 0)
 #define GIT_MERGE_INDEX_ENTRY_ISFILE(X) S_ISREG((X).mode)
 
+
+/** Internal merge flags. */
+enum {
+	/** The merge is for a virtual base in a recursive merge. */
+	GIT_MERGE__VIRTUAL_BASE = (1 << 31),
+};
+
+enum {
+	/** Accept the conflict file, staging it as the merge result. */
+	GIT_MERGE_FILE_FAVOR__CONFLICTED = 4,
+};
+
+
 typedef enum {
 	TREE_IDX_ANCESTOR = 0,
 	TREE_IDX_OURS = 1,
@@ -799,11 +814,9 @@ static int merge_conflict_resolve_automerge(
 	int *resolved,
 	git_merge_diff_list *diff_list,
 	const git_merge_diff *conflict,
-	unsigned int merge_file_favor,
-	unsigned int file_flags)
+	const git_merge_file_options *file_opts)
 {
 	const git_index_entry *ancestor = NULL, *ours = NULL, *theirs = NULL;
-	git_merge_file_options opts = GIT_MERGE_FILE_OPTIONS_INIT;
 	git_merge_file_result result = {0};
 	git_index_entry *index_entry;
 	git_odb *odb = NULL;
@@ -850,12 +863,9 @@ static int merge_conflict_resolve_automerge(
 	theirs = GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->their_entry) ?
 		&conflict->their_entry : NULL;
 
-	opts.favor = merge_file_favor;
-	opts.flags = file_flags;
-
 	if ((error = git_repository_odb(&odb, diff_list->repo)) < 0 ||
-		(error = git_merge_file_from_index(&result, diff_list->repo, ancestor, ours, theirs, &opts)) < 0 ||
-		!result.automergeable ||
+		(error = git_merge_file_from_index(&result, diff_list->repo, ancestor, ours, theirs, file_opts)) < 0 ||
+		(!result.automergeable && !(file_opts->flags & GIT_MERGE_FILE_FAVOR__CONFLICTED)) ||
 		(error = git_odb_write(&automerge_oid, odb, result.ptr, result.len, GIT_OBJ_BLOB)) < 0)
 		goto done;
 
@@ -885,8 +895,7 @@ static int merge_conflict_resolve(
 	int *out,
 	git_merge_diff_list *diff_list,
 	const git_merge_diff *conflict,
-	unsigned int merge_file_favor,
-	unsigned int file_flags)
+	const git_merge_file_options *file_opts)
 {
 	int resolved = 0;
 	int error = 0;
@@ -902,8 +911,7 @@ static int merge_conflict_resolve(
 	if (!resolved && (error = merge_conflict_resolve_one_renamed(&resolved, diff_list, conflict)) < 0)
 		goto done;
 
-	if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict,
-		merge_file_favor, file_flags)) < 0)
+	if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, file_opts)) < 0)
 		goto done;
 
 	*out = resolved;
@@ -1296,7 +1304,7 @@ int git_merge_diff_list__find_renames(
 
 	assert(diff_list && opts);
 
-	if ((opts->tree_flags & GIT_MERGE_TREE_FIND_RENAMES) == 0)
+	if ((opts->flags & GIT_MERGE_FIND_RENAMES) == 0)
 		return 0;
 
 	similarity_ours = git__calloc(diff_list->conflicts.length,
@@ -1632,8 +1640,8 @@ static int merge_normalize_opts(
 		git_merge_options init = GIT_MERGE_OPTIONS_INIT;
 		memcpy(opts, &init, sizeof(init));
 
-		opts->tree_flags = GIT_MERGE_TREE_FIND_RENAMES;
-		opts->rename_threshold = GIT_MERGE_TREE_RENAME_THRESHOLD;
+		opts->flags = GIT_MERGE_FIND_RENAMES;
+		opts->rename_threshold = GIT_MERGE_DEFAULT_RENAME_THRESHOLD;
 	}
 
 	if (!opts->target_limit) {
@@ -1643,7 +1651,7 @@ static int merge_normalize_opts(
 			limit = git_config__get_int_force(cfg, "diff.renamelimit", 0);
 
 		opts->target_limit = (limit <= 0) ?
-			GIT_MERGE_TREE_TARGET_LIMIT : (unsigned int)limit;
+			GIT_MERGE_DEFAULT_TARGET_LIMIT : (unsigned int)limit;
 	}
 
 	/* assign the internal metric with whitespace flag as payload */
@@ -1827,6 +1835,7 @@ int git_merge__iterators(
 		*empty_theirs = NULL;
 	git_merge_diff_list *diff_list;
 	git_merge_options opts;
+	git_merge_file_options file_opts = GIT_MERGE_FILE_OPTIONS_INIT;
 	git_merge_diff *conflict;
 	git_vector changes;
 	size_t i;
@@ -1842,6 +1851,17 @@ int git_merge__iterators(
 	if ((error = merge_normalize_opts(repo, &opts, given_opts)) < 0)
 		return error;
 
+	file_opts.favor = opts.file_favor;
+	file_opts.flags = opts.file_flags;
+
+	/* use the git-inspired labels when virtual base building */
+	if (opts.flags & GIT_MERGE__VIRTUAL_BASE) {
+		file_opts.ancestor_label = "merged common ancestors";
+		file_opts.our_label = "Temporary merge branch 1";
+		file_opts.their_label = "Temporary merge branch 2";
+		file_opts.flags |= GIT_MERGE_FILE_FAVOR__CONFLICTED;
+	}
+
 	diff_list = git_merge_diff_list__alloc(repo);
 	GITERR_CHECK_ALLOC(diff_list);
 
@@ -1860,11 +1880,12 @@ int git_merge__iterators(
 	git_vector_foreach(&changes, i, conflict) {
 		int resolved = 0;
 
-		if ((error = merge_conflict_resolve(&resolved, diff_list, conflict, opts.file_favor, opts.file_flags)) < 0)
+		if ((error = merge_conflict_resolve(
+			&resolved, diff_list, conflict, &file_opts)) < 0)
 			goto done;
 
 		if (!resolved) {
-			if ((opts.tree_flags & GIT_MERGE_TREE_FAIL_ON_CONFLICT)) {
+			if ((opts.flags & GIT_MERGE_FAIL_ON_CONFLICT)) {
 				giterr_set(GITERR_MERGE, "merge conflicts exist");
 				error = GIT_EMERGECONFLICT;
 				goto done;
@@ -1875,7 +1896,7 @@ int git_merge__iterators(
 	}
 
 	error = index_from_diff_list(out, diff_list,
-		(opts.tree_flags & GIT_MERGE_TREE_SKIP_REUC));
+		(opts.flags & GIT_MERGE_SKIP_REUC));
 
 done:
 	if (!given_opts || !given_opts->metric)
@@ -1922,6 +1943,207 @@ done:
 	return error;
 }
 
+static int merge_annotated_commits(
+	git_index **index_out,
+	git_annotated_commit **base_out,
+	git_repository *repo,
+	git_annotated_commit *our_commit,
+	git_annotated_commit *their_commit,
+	size_t recursion_level,
+	const git_merge_options *opts);
+
+GIT_INLINE(int) insert_head_ids(
+	git_array_oid_t *ids,
+	const git_annotated_commit *annotated_commit)
+{
+	git_oid *id;
+	size_t i;
+
+	if (annotated_commit->type == GIT_ANNOTATED_COMMIT_REAL) {
+		id = git_array_alloc(*ids);
+		GITERR_CHECK_ALLOC(id);
+
+		git_oid_cpy(id, git_commit_id(annotated_commit->commit));
+	} else {
+		for (i = 0; i < annotated_commit->parents.size; i++) {
+			id = git_array_alloc(*ids);
+			GITERR_CHECK_ALLOC(id);
+
+			git_oid_cpy(id, &annotated_commit->parents.ptr[i]);
+		}
+	}
+
+	return 0;
+}
+
+static int create_virtual_base(
+	git_annotated_commit **out,
+	git_repository *repo,
+	git_annotated_commit *one,
+	git_annotated_commit *two,
+	const git_merge_options *opts,
+	size_t recursion_level)
+{
+	git_annotated_commit *result = NULL;
+	git_index *index = NULL;
+	git_merge_options virtual_opts = GIT_MERGE_OPTIONS_INIT;
+
+	result = git__calloc(1, sizeof(git_annotated_commit));
+	GITERR_CHECK_ALLOC(result);
+
+	/* Conflicts in the merge base creation do not propagate to conflicts
+	 * in the result; the conflicted base will act as the common ancestor.
+	 */
+	if (opts)
+		memcpy(&virtual_opts, opts, sizeof(git_merge_options));
+
+	virtual_opts.flags &= ~GIT_MERGE_FAIL_ON_CONFLICT;
+	virtual_opts.flags |= GIT_MERGE__VIRTUAL_BASE;
+
+	if ((merge_annotated_commits(&index, NULL, repo, one, two,
+			recursion_level + 1, &virtual_opts)) < 0)
+		return -1;
+
+	result->type = GIT_ANNOTATED_COMMIT_VIRTUAL;
+	result->index = index;
+
+	insert_head_ids(&result->parents, one);
+	insert_head_ids(&result->parents, two);
+
+	*out = result;
+	return 0;
+}
+
+static int compute_base(
+	git_annotated_commit **out,
+	git_repository *repo,
+	const git_annotated_commit *one,
+	const git_annotated_commit *two,
+	const git_merge_options *given_opts,
+	size_t recursion_level)
+{
+	git_array_oid_t head_ids = GIT_ARRAY_INIT;
+	git_oidarray bases = {0};
+	git_annotated_commit *base = NULL, *other = NULL, *new_base = NULL;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+	size_t i;
+	int error;
+
+	*out = NULL;
+
+	if (given_opts)
+		memcpy(&opts, given_opts, sizeof(git_merge_options));
+
+	if ((error = insert_head_ids(&head_ids, one)) < 0 ||
+		(error = insert_head_ids(&head_ids, two)) < 0)
+		goto done;
+
+	if ((error = git_merge_bases_many(&bases, repo,
+			head_ids.size, head_ids.ptr)) < 0 ||
+		(error = git_annotated_commit_lookup(&base, repo, &bases.ids[0])) < 0 ||
+		(opts.flags & GIT_MERGE_NO_RECURSIVE))
+		goto done;
+
+	for (i = 1; i < bases.count; i++) {
+		recursion_level++;
+
+		if (opts.recursion_limit && recursion_level > opts.recursion_limit)
+			break;
+
+		if ((error = git_annotated_commit_lookup(&other, repo,
+				&bases.ids[i])) < 0 ||
+			(error = create_virtual_base(&new_base, repo, base, other, &opts,
+				recursion_level)) < 0)
+			goto done;
+
+		git_annotated_commit_free(base);
+		git_annotated_commit_free(other);
+
+		base = new_base;
+		new_base = NULL;
+		other = NULL;
+	}
+
+done:
+	if (error == 0)
+		*out = base;
+	else
+		git_annotated_commit_free(base);
+
+	git_annotated_commit_free(other);
+	git_annotated_commit_free(new_base);
+	git_oidarray_free(&bases);
+	git_array_clear(head_ids);
+	return error;
+}
+
+static int iterator_for_annotated_commit(
+	git_iterator **out,
+	git_annotated_commit *commit)
+{
+	git_iterator_options opts = GIT_ITERATOR_OPTIONS_INIT;
+	int error;
+
+	opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE;
+
+	if (commit == NULL) {
+		error = git_iterator_for_nothing(out, &opts); 
+	} else if (commit->type == GIT_ANNOTATED_COMMIT_VIRTUAL) {
+		error = git_iterator_for_index(out, commit->index, &opts);
+	} else {
+		if (!commit->tree &&
+			(error = git_commit_tree(&commit->tree, commit->commit)) < 0)
+			goto done;
+
+		error = git_iterator_for_tree(out, commit->tree, &opts);
+	}
+
+done:
+	return error;
+}
+
+static int merge_annotated_commits(
+	git_index **index_out,
+	git_annotated_commit **base_out,
+	git_repository *repo,
+	git_annotated_commit *ours,
+	git_annotated_commit *theirs,
+	size_t recursion_level,
+	const git_merge_options *opts)
+{
+	git_annotated_commit *base = NULL;
+	git_iterator *base_iter = NULL, *our_iter = NULL, *their_iter = NULL;
+	int error;
+
+    if ((error = compute_base(&base, repo, ours, theirs, opts,
+		recursion_level)) < 0) {
+
+        if (error != GIT_ENOTFOUND)
+            goto done;
+
+        giterr_clear();
+    }
+
+	if ((error = iterator_for_annotated_commit(&base_iter, base)) < 0 ||
+		(error = iterator_for_annotated_commit(&our_iter, ours)) < 0 ||
+		(error = iterator_for_annotated_commit(&their_iter, theirs)) < 0 ||
+		(error = git_merge__iterators(index_out, repo, base_iter, our_iter,
+			their_iter, opts)) < 0)
+		goto done;
+
+	if (base_out) {
+		*base_out = base;
+		base = NULL;
+	}
+
+done:
+	git_annotated_commit_free(base);
+	git_iterator_free(base_iter);
+	git_iterator_free(our_iter);
+	git_iterator_free(their_iter);
+	return error;
+}
+
 
 int git_merge_commits(
 	git_index **out,
@@ -1930,30 +2152,19 @@ int git_merge_commits(
 	const git_commit *their_commit,
 	const git_merge_options *opts)
 {
-	git_oid ancestor_oid;
-	git_commit *ancestor_commit = NULL;
-	git_tree *our_tree = NULL, *their_tree = NULL, *ancestor_tree = NULL;
+	git_annotated_commit *ours = NULL, *theirs = NULL, *base = NULL;
 	int error = 0;
 
-	if ((error = git_merge_base(&ancestor_oid, repo, git_commit_id(our_commit), git_commit_id(their_commit))) < 0 &&
-		error == GIT_ENOTFOUND)
-		giterr_clear();
-	else if (error < 0 ||
-		(error = git_commit_lookup(&ancestor_commit, repo, &ancestor_oid)) < 0 ||
-		(error = git_commit_tree(&ancestor_tree, ancestor_commit)) < 0)
+	if ((error = git_annotated_commit_from_commit(&ours, (git_commit *)our_commit)) < 0 ||
+		(error = git_annotated_commit_from_commit(&theirs, (git_commit *)their_commit)) < 0)
 		goto done;
 
-	if ((error = git_commit_tree(&our_tree, our_commit)) < 0 ||
-		(error = git_commit_tree(&their_tree, their_commit)) < 0 ||
-		(error = git_merge_trees(out, repo, ancestor_tree, our_tree, their_tree, opts)) < 0)
-		goto done;
+	error = merge_annotated_commits(out, &base, repo, ours, theirs, 0, opts);
 
 done:
-	git_commit_free(ancestor_commit);
-	git_tree_free(our_tree);
-	git_tree_free(their_tree);
-	git_tree_free(ancestor_tree);
-
+	git_annotated_commit_free(ours);
+	git_annotated_commit_free(theirs);
+	git_annotated_commit_free(base);
 	return error;
 }
 
@@ -2387,49 +2598,50 @@ const char *merge_their_label(const char *branchname)
 }
 
 static int merge_normalize_checkout_opts(
+	git_checkout_options *out,
 	git_repository *repo,
-	git_checkout_options *checkout_opts,
 	const git_checkout_options *given_checkout_opts,
-	const git_annotated_commit *ancestor_head,
+	unsigned int checkout_strategy,
+	git_annotated_commit *ancestor,
 	const git_annotated_commit *our_head,
-	size_t their_heads_len,
-	const git_annotated_commit **their_heads)
+	const git_annotated_commit **their_heads,
+	size_t their_heads_len)
 {
+	git_checkout_options default_checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
 	int error = 0;
 
 	GIT_UNUSED(repo);
 
 	if (given_checkout_opts != NULL)
-		memcpy(checkout_opts, given_checkout_opts, sizeof(git_checkout_options));
-	else {
-		git_checkout_options default_checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
-		default_checkout_opts.checkout_strategy =  GIT_CHECKOUT_SAFE;
+		memcpy(out, given_checkout_opts, sizeof(git_checkout_options));
+	else
+		memcpy(out, &default_checkout_opts, sizeof(git_checkout_options));
 
-		memcpy(checkout_opts, &default_checkout_opts, sizeof(git_checkout_options));
-	}
+	out->checkout_strategy = checkout_strategy;
 
-	/* TODO: for multiple ancestors in merge-recursive, this is "merged common ancestors" */
-	if (!checkout_opts->ancestor_label) {
-		if (ancestor_head && ancestor_head->commit)
-			checkout_opts->ancestor_label = git_commit_summary(ancestor_head->commit);
+	if (!out->ancestor_label) {
+		if (ancestor && ancestor->type == GIT_ANNOTATED_COMMIT_REAL)
+			out->ancestor_label = git_commit_summary(ancestor->commit);
+		else if (ancestor)
+			out->ancestor_label = "merged common ancestors";
 		else
-			checkout_opts->ancestor_label = "ancestor";
+			out->ancestor_label = "empty base";
 	}
 
-	if (!checkout_opts->our_label) {
+	if (!out->our_label) {
 		if (our_head && our_head->ref_name)
-			checkout_opts->our_label = our_head->ref_name;
+			out->our_label = our_head->ref_name;
 		else
-			checkout_opts->our_label = "ours";
+			out->our_label = "ours";
 	}
 
-	if (!checkout_opts->their_label) {
+	if (!out->their_label) {
 		if (their_heads_len == 1 && their_heads[0]->ref_name)
-			checkout_opts->their_label = merge_their_label(their_heads[0]->ref_name);
+			out->their_label = merge_their_label(their_heads[0]->ref_name);
 		else if (their_heads_len == 1)
-			checkout_opts->their_label = their_heads[0]->id_str;
+			out->their_label = their_heads[0]->id_str;
 		else
-			checkout_opts->their_label = "theirs";
+			out->their_label = "theirs";
 	}
 
 	return error;
@@ -2782,11 +2994,10 @@ int git_merge(
 {
 	git_reference *our_ref = NULL;
 	git_checkout_options checkout_opts;
-	git_annotated_commit *ancestor_head = NULL, *our_head = NULL;
-	git_tree *ancestor_tree = NULL, *our_tree = NULL, **their_trees = NULL;
+	git_annotated_commit *our_head = NULL, *base = NULL;
 	git_index *index = NULL;
 	git_indexwriter indexwriter = GIT_INDEXWRITER_INIT;
-	size_t i;
+	unsigned int checkout_strategy;
 	int error = 0;
 
 	assert(repo && their_heads);
@@ -2796,61 +3007,49 @@ int git_merge(
 		return -1;
 	}
 
-	their_trees = git__calloc(their_heads_len, sizeof(git_tree *));
-	GITERR_CHECK_ALLOC(their_trees);
-
-	if ((error = merge_heads(&ancestor_head, &our_head, repo, their_heads, their_heads_len)) < 0 ||
-		(error = merge_normalize_checkout_opts(repo, &checkout_opts, given_checkout_opts,
-			ancestor_head, our_head, their_heads_len, their_heads)) < 0 ||
-		(error = git_indexwriter_init_for_operation(&indexwriter, repo, &checkout_opts.checkout_strategy)) < 0)
-		goto on_error;
-
-	/* Write the merge files to the repository. */
-	if ((error = git_merge__setup(repo, our_head, their_heads, their_heads_len)) < 0)
-		goto on_error;
+	if ((error = git_repository__ensure_not_bare(repo, "merge")) < 0)
+		goto done;
 
-	if (ancestor_head != NULL &&
-		(error = git_commit_tree(&ancestor_tree, ancestor_head->commit)) < 0)
-			goto on_error;
+	checkout_strategy = given_checkout_opts ?
+		given_checkout_opts->checkout_strategy :
+		GIT_CHECKOUT_SAFE;
 
-	if ((error = git_commit_tree(&our_tree, our_head->commit)) < 0)
-		goto on_error;
+	if ((error = git_indexwriter_init_for_operation(&indexwriter, repo,
+		&checkout_strategy)) < 0)
+		goto done;
 
-	for (i = 0; i < their_heads_len; i++) {
-		if ((error = git_commit_tree(&their_trees[i], their_heads[i]->commit)) < 0)
-			goto on_error;
-	}
+	/* Write the merge setup files to the repository. */
+	if ((error = git_annotated_commit_from_head(&our_head, repo)) < 0 ||
+		(error = git_merge__setup(repo, our_head, their_heads,
+			their_heads_len)) < 0)
+		goto done;
 
-	/* TODO: recursive, octopus, etc... */
+	/* TODO: octopus */
 
-	if ((error = git_merge_trees(&index, repo, ancestor_tree, our_tree, their_trees[0], merge_opts)) < 0 ||
+	if ((error = merge_annotated_commits(&index, &base, repo, our_head,
+			(git_annotated_commit *)their_heads[0], 0, merge_opts)) < 0 ||
 		(error = git_merge__check_result(repo, index)) < 0 ||
-		(error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0 ||
-		(error = git_checkout_index(repo, index, &checkout_opts)) < 0 ||
-		(error = git_indexwriter_commit(&indexwriter)) < 0)
-		goto on_error;
+		(error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0)
+		goto done;
 
-	goto done;
+	/* check out the merge results */
 
-on_error:
-	merge_state_cleanup(repo);
+	if ((error = merge_normalize_checkout_opts(&checkout_opts, repo,
+			given_checkout_opts, checkout_strategy,
+			base, our_head, their_heads, their_heads_len)) < 0 ||
+		(error = git_checkout_index(repo, index, &checkout_opts)) < 0)
+		goto done;
+
+	error = git_indexwriter_commit(&indexwriter);
 
 done:
-	git_indexwriter_cleanup(&indexwriter);
+	if (error < 0)
+		merge_state_cleanup(repo);
 
+	git_indexwriter_cleanup(&indexwriter);
 	git_index_free(index);
-
-	git_tree_free(ancestor_tree);
-	git_tree_free(our_tree);
-
-	for (i = 0; i < their_heads_len; i++)
-		git_tree_free(their_trees[i]);
-
-	git__free(their_trees);
-
 	git_annotated_commit_free(our_head);
-	git_annotated_commit_free(ancestor_head);
-
+	git_annotated_commit_free(base);
 	git_reference_free(our_ref);
 
 	return error;
diff --git a/src/merge.h b/src/merge.h
index 3caf617..bd839be 100644
--- a/src/merge.h
+++ b/src/merge.h
@@ -19,8 +19,8 @@
 #define GIT_MERGE_MODE_FILE		"MERGE_MODE"
 #define GIT_MERGE_FILE_MODE		0666
 
-#define GIT_MERGE_TREE_RENAME_THRESHOLD	50
-#define GIT_MERGE_TREE_TARGET_LIMIT		1000
+#define GIT_MERGE_DEFAULT_RENAME_THRESHOLD	50
+#define GIT_MERGE_DEFAULT_TARGET_LIMIT		1000
 
 /** Types of changes when files are merged from branch to branch. */
 typedef enum {
diff --git a/tests/cherrypick/workdir.c b/tests/cherrypick/workdir.c
index 787f1f4..2b45f5a 100644
--- a/tests/cherrypick/workdir.c
+++ b/tests/cherrypick/workdir.c
@@ -300,7 +300,7 @@ void test_cherrypick_workdir__rename(void)
 		{ 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 0, "file3.txt.renamed" },
 	};
 
-	opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
 	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
@@ -335,7 +335,7 @@ void test_cherrypick_workdir__both_renamed(void)
 		{ 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 2, "file3.txt.renamed_on_branch" },
 	};
 
-	opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
 	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "44cd2ed2052c9c68f9a439d208e9614dc2a55c70");
diff --git a/tests/merge/conflict_data.h b/tests/merge/conflict_data.h
new file mode 100644
index 0000000..e6394a9
--- /dev/null
+++ b/tests/merge/conflict_data.h
@@ -0,0 +1,103 @@
+#define AUTOMERGEABLE_MERGED_FILE \
+	"this file is changed in master\n" \
+	"this file is automergeable\n" \
+	"this file is automergeable\n" \
+	"this file is automergeable\n" \
+	"this file is automergeable\n" \
+	"this file is automergeable\n" \
+	"this file is automergeable\n" \
+	"this file is automergeable\n" \
+	"this file is changed in branch\n"
+
+#define AUTOMERGEABLE_MERGED_FILE_CRLF \
+	"this file is changed in master\r\n" \
+	"this file is automergeable\r\n" \
+	"this file is automergeable\r\n" \
+	"this file is automergeable\r\n" \
+	"this file is automergeable\r\n" \
+	"this file is automergeable\r\n" \
+	"this file is automergeable\r\n" \
+	"this file is automergeable\r\n" \
+	"this file is changed in branch\r\n"
+
+#define CONFLICTING_MERGE_FILE \
+	"<<<<<<< HEAD\n" \
+	"this file is changed in master and branch\n" \
+	"=======\n" \
+	"this file is changed in branch and master\n" \
+	">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n"
+
+#define CONFLICTING_DIFF3_FILE \
+	"<<<<<<< HEAD\n" \
+	"this file is changed in master and branch\n" \
+	"||||||| initial\n" \
+	"this file is a conflict\n" \
+	"=======\n" \
+	"this file is changed in branch and master\n" \
+	">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n"
+
+#define CONFLICTING_UNION_FILE \
+	"this file is changed in master and branch\n" \
+	"this file is changed in branch and master\n"
+
+#define CONFLICTING_RECURSIVE_F1_TO_F2 \
+	"VEAL SOUP.\n" \
+	"\n" \
+	"<<<<<<< HEAD\n" \
+	"PUT INTO A POT THREE QUARTS OF WATER, three onions cut small, ONE\n" \
+	"=======\n" \
+	"PUT INTO A POT THREE QUARTS OF WATER, three onions cut not too small, one\n" \
+	">>>>>>> branchF-2\n" \
+	"spoonful of black pepper pounded, and two of salt, with two or three\n" \
+	"slices of lean ham; let it boil steadily two hours; skim it\n" \
+	"occasionally, then put into it a shin of veal, let it boil two hours\n" \
+	"longer; take out the slices of ham, and skim off the grease if any\n" \
+	"should rise, take a gill of good cream, mix with it two table-spoonsful\n" \
+	"of flour very nicely, and the yelks of two eggs beaten well, strain this\n" \
+	"mixture, and add some chopped parsley; pour some soup on by degrees,\n" \
+	"stir it well, and pour it into the pot, continuing to stir until it has\n" \
+	"boiled two or three minutes to take off the raw taste of the eggs. If\n" \
+	"the cream be not perfectly sweet, and the eggs quite new, the thickening\n" \
+	"will curdle in the soup. For a change you may put a dozen ripe tomatos\n" \
+	"in, first taking off their skins, by letting them stand a few minutes in\n" \
+	"hot water, when they may be easily peeled. When made in this way you\n" \
+	"must thicken it with the flour only. Any part of the veal may be used,\n" \
+	"but the shin or knuckle is the nicest.\n" \
+	"\n" \
+	"<<<<<<< HEAD\n" \
+	"This certainly is a mighty fine recipe.\n" \
+	"=======\n" \
+	"This is a mighty fine recipe!\n" \
+	">>>>>>> branchF-2\n"
+
+#define CONFLICTING_RECURSIVE_H1_TO_H2_WITH_DIFF3 \
+	"VEAL SOUP.\n" \
+	"\n" \
+	"<<<<<<< HEAD\n" \
+	"put into a pot three quarts of water, three onions cut small, one\n" \
+	"||||||| merged common ancestors\n" \
+	"<<<<<<< Temporary merge branch 1\n" \
+	"Put into a pot three quarts of water, THREE ONIONS CUT SMALL, one\n" \
+	"||||||| merged common ancestors\n" \
+	"Put into a pot three quarts of water, three onions cut small, one\n" \
+	"=======\n" \
+	"PUT INTO A POT three quarts of water, three onions cut small, one\n" \
+	">>>>>>> Temporary merge branch 2\n" \
+	"=======\n" \
+	"Put Into A Pot Three Quarts of Water, Three Onions Cut Small, One\n" \
+	">>>>>>> branchH-2\n" \
+	"spoonful of black pepper pounded, and two of salt, with two or three\n" \
+	"slices of lean ham; let it boil steadily two hours; skim it\n" \
+	"occasionally, then put into it a shin of veal, let it boil two hours\n" \
+	"longer; take out the slices of ham, and skim off the grease if any\n" \
+	"should rise, take a gill of good cream, mix with it two table-spoonsful\n" \
+	"of flour very nicely, and the yelks of two eggs beaten well, strain this\n" \
+	"mixture, and add some chopped parsley; pour some soup on by degrees,\n" \
+	"stir it well, and pour it into the pot, continuing to stir until it has\n" \
+	"boiled two or three minutes to take off the raw taste of the eggs. If\n" \
+	"the cream be not perfectly sweet, and the eggs quite new, the thickening\n" \
+	"will curdle in the soup. For a change you may put a dozen ripe tomatos\n" \
+	"in, first taking off their skins, by letting them stand a few minutes in\n" \
+	"hot water, when they may be easily peeled. When made in this way you\n" \
+	"must thicken it with the flour only. Any part of the veal may be used,\n" \
+	"but the shin or knuckle is the nicest.\n"
diff --git a/tests/merge/files.c b/tests/merge/files.c
index 2d55df2..daa73fa 100644
--- a/tests/merge/files.c
+++ b/tests/merge/files.c
@@ -4,6 +4,7 @@
 #include "buffer.h"
 #include "merge.h"
 #include "merge_helpers.h"
+#include "conflict_data.h"
 #include "refs.h"
 #include "fileops.h"
 #include "diff_xdiff.h"
diff --git a/tests/merge/merge_helpers.c b/tests/merge/merge_helpers.c
index 986a365..4b1b7d2 100644
--- a/tests/merge/merge_helpers.c
+++ b/tests/merge/merge_helpers.c
@@ -4,6 +4,7 @@
 #include "tree.h"
 #include "merge_helpers.h"
 #include "merge.h"
+#include "index.h"
 #include "git2/merge.h"
 #include "git2/sys/index.h"
 #include "git2/annotated_commit.h"
@@ -239,7 +240,7 @@ int merge_test_index(git_index *index, const struct merge_index_entry expected[]
 	const git_index_entry *index_entry;
 
 	/*
-	dump_index_entries(&index->entries);
+	merge__dump_index_entries(&index->entries);
 	*/
 
 	if (git_index_entrycount(index) != expected_len)
diff --git a/tests/merge/merge_helpers.h b/tests/merge/merge_helpers.h
index 554c24b..e407c7d 100644
--- a/tests/merge/merge_helpers.h
+++ b/tests/merge/merge_helpers.h
@@ -4,49 +4,6 @@
 #include "merge.h"
 #include "git2/merge.h"
 
-#define AUTOMERGEABLE_MERGED_FILE \
-	"this file is changed in master\n" \
-	"this file is automergeable\n" \
-	"this file is automergeable\n" \
-	"this file is automergeable\n" \
-	"this file is automergeable\n" \
-	"this file is automergeable\n" \
-	"this file is automergeable\n" \
-	"this file is automergeable\n" \
-	"this file is changed in branch\n"
-
-#define AUTOMERGEABLE_MERGED_FILE_CRLF \
-	"this file is changed in master\r\n" \
-	"this file is automergeable\r\n" \
-	"this file is automergeable\r\n" \
-	"this file is automergeable\r\n" \
-	"this file is automergeable\r\n" \
-	"this file is automergeable\r\n" \
-	"this file is automergeable\r\n" \
-	"this file is automergeable\r\n" \
-	"this file is changed in branch\r\n"
-
-#define CONFLICTING_MERGE_FILE \
-	"<<<<<<< HEAD\n" \
-	"this file is changed in master and branch\n" \
-	"=======\n" \
-	"this file is changed in branch and master\n" \
-	">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n"
-
-#define CONFLICTING_DIFF3_FILE \
-	"<<<<<<< HEAD\n" \
-	"this file is changed in master and branch\n" \
-	"||||||| initial\n" \
-	"this file is a conflict\n" \
-	"=======\n" \
-	"this file is changed in branch and master\n" \
-	">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n"
-
-#define CONFLICTING_UNION_FILE \
-	"this file is changed in master and branch\n" \
-	"this file is changed in branch and master\n"
-
-
 struct merge_index_entry {
 	uint16_t mode;
 	char oid_str[GIT_OID_HEXSZ+1];
diff --git a/tests/merge/trees/automerge.c b/tests/merge/trees/automerge.c
index c18881d..67f2cf7 100644
--- a/tests/merge/trees/automerge.c
+++ b/tests/merge/trees/automerge.c
@@ -3,8 +3,9 @@
 #include "git2/merge.h"
 #include "buffer.h"
 #include "merge.h"
-#include "../merge_helpers.h"
 #include "fileops.h"
+#include "../merge_helpers.h"
+#include "../conflict_data.h"
 
 static git_repository *repo;
 
diff --git a/tests/merge/trees/commits.c b/tests/merge/trees/commits.c
index 2e3c457..786a77a 100644
--- a/tests/merge/trees/commits.c
+++ b/tests/merge/trees/commits.c
@@ -3,6 +3,7 @@
 #include "git2/merge.h"
 #include "merge.h"
 #include "../merge_helpers.h"
+#include "../conflict_data.h"
 
 static git_repository *repo;
 
@@ -134,7 +135,7 @@ void test_merge_trees_commits__fail_on_conflict(void)
 	git_index *index;
 	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 
-	opts.tree_flags |= GIT_MERGE_TREE_FAIL_ON_CONFLICT;
+	opts.flags |= GIT_MERGE_FAIL_ON_CONFLICT;
 
 	cl_git_fail_with(GIT_EMERGECONFLICT, 
 		merge_trees_from_branches(&index, repo, "df_side1", "df_side2", &opts));
diff --git a/tests/merge/trees/recursive.c b/tests/merge/trees/recursive.c
new file mode 100644
index 0000000..c5b129b
--- /dev/null
+++ b/tests/merge/trees/recursive.c
@@ -0,0 +1,410 @@
+#include "clar_libgit2.h"
+#include "git2/repository.h"
+#include "git2/merge.h"
+#include "merge.h"
+#include "../merge_helpers.h"
+
+static git_repository *repo;
+
+#define TEST_REPO_PATH "merge-recursive"
+
+void test_merge_trees_recursive__initialize(void)
+{
+	repo = cl_git_sandbox_init(TEST_REPO_PATH);
+}
+
+void test_merge_trees_recursive__cleanup(void)
+{
+	cl_git_sandbox_cleanup();
+}
+
+void test_merge_trees_recursive__one_base_commit(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "dea7215f259b2cced87d1bda6c72f8b4ce37a2ff", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "94d2c01087f48213bd157222d54edfefd77c9bba", 0, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchA-1", "branchA-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__one_base_commit_norecursive(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "dea7215f259b2cced87d1bda6c72f8b4ce37a2ff", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "94d2c01087f48213bd157222d54edfefd77c9bba", 0, "veal.txt" },
+	};
+
+	opts.flags |= GIT_MERGE_NO_RECURSIVE;
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchA-1", "branchA-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__two_base_commits(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "666ffdfcf1eaa5641fa31064bf2607327e843c09", 0, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchB-1", "branchB-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__two_base_commits_norecursive(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "cb49ad76147f5f9439cbd6133708b76142660660", 1, "veal.txt" },
+		{ 0100644, "b2a81ead9e722af0099fccfb478cea88eea749a2", 2, "veal.txt" },
+		{ 0100644, "4e21d2d63357bde5027d1625f5ec6b430cdeb143", 3, "veal.txt" },
+	};
+
+	opts.flags |= GIT_MERGE_NO_RECURSIVE;
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchB-1", "branchB-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__two_levels_of_multiple_bases(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "15faa0c9991f2d65686e844651faa2ff9827887b", 0, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchC-1", "branchC-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__two_levels_of_multiple_bases_norecursive(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "b2a81ead9e722af0099fccfb478cea88eea749a2", 1, "veal.txt" },
+		{ 0100644, "898d12687fb35be271c27c795a6b32c8b51da79e", 2, "veal.txt" },
+		{ 0100644, "68a2e1ee61a23a4728fe6b35580fbbbf729df370", 3, "veal.txt" },
+	};
+
+	opts.flags |= GIT_MERGE_NO_RECURSIVE;
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchC-1", "branchC-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__three_levels_of_multiple_bases(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "d55e5dc038c52f1a36548625bcb666cbc06db9e6", 0, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchD-2", "branchD-1", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__three_levels_of_multiple_bases_norecursive(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "898d12687fb35be271c27c795a6b32c8b51da79e", 1, "veal.txt" },
+		{ 0100644, "f1b44c04989a3a1c14b036cfadfa328d53a7bc5e", 2, "veal.txt" },
+		{ 0100644, "5e8747f5200fac0f945a07daf6163ca9cb1a8da9", 3, "veal.txt" },
+	};
+
+	opts.flags |= GIT_MERGE_NO_RECURSIVE;
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchD-2", "branchD-1", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__three_base_commits(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4f7269b07c76d02755d75ccaf05c0b4c36cdc6c", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "a7b066537e6be7109abfe4ff97b675d4e077da20", 0, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchE-1", "branchE-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__three_base_commits_norecursive(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "9e12bce04446d097ae1782967a5888c2e2a0d35b", 1, "gravy.txt" },
+		{ 0100644, "d8dd349b78f19a4ebe3357bacb8138f00bf5ed41", 2, "gravy.txt" },
+		{ 0100644, "e50fbbd701458757bdfe9815f58ed717c588d1b5", 3, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "a7b066537e6be7109abfe4ff97b675d4e077da20", 0, "veal.txt" },
+	};
+
+	opts.flags |= GIT_MERGE_NO_RECURSIVE;
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchE-1", "branchE-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	git_index_free(index);
+}
+
+void test_merge_trees_recursive__conflict(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "fa567f568ed72157c0c617438d077695b99d9aac", 1, "veal.txt" },
+		{ 0100644, "21950d5e4e4d1a871b4dfcf72ecb6b9c162c434e", 2, "veal.txt" },
+		{ 0100644, "3855170cef875708da06ab9ad7fc6a73b531cda1", 3, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchF-1", "branchF-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	git_index_free(index);
+}
+
+/* 
+ * Branch G-1 and G-2 have three common ancestors (815b5a1, ad2ace9, 483065d).
+ * The merge-base of the first two has two common ancestors (723181f, a34e5a1)
+ * which themselves have two common ancestors (8f35f30, 3a3f5a6), which
+ * finally has a common ancestor of 7c7bf85.  This virtual merge base will
+ * be computed and merged with 483065d which also has a common ancestor of
+ * 7c7bf85.
+ */
+void test_merge_trees_recursive__oh_so_many_levels_of_recursion(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "7c7e08f9559d9e1551b91e1cf68f1d0066109add", 0, "oyster.txt" },
+		{ 0100644, "898d12687fb35be271c27c795a6b32c8b51da79e", 0, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchG-1", "branchG-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+	git_index_free(index);
+}
+
+/* Branch H-1 and H-2 have two common ancestors (aa9e263, 6ef31d3).  The two
+ * ancestors themselves conflict.
+ */
+void test_merge_trees_recursive__conflicting_merge_base(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "3a66812fed1e03ea4a6a7ee28d8a57aec1ca6537", 1, "veal.txt" },
+		{ 0100644, "d604c75019c282144bdbbf3fd3462ba74b240efc", 2, "veal.txt" },
+		{ 0100644, "37a5054a9f9b4628e3924c5cb8f2147c6e2a3efc", 3, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchH-1", "branchH-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	git_index_free(index);
+}
+
+/* Branch H-1 and H-2 have two common ancestors (aa9e263, 6ef31d3).  The two
+ * ancestors themselves conflict.  The generated common ancestor file will
+ * have diff3 style conflicts inside it.
+ */
+void test_merge_trees_recursive__conflicting_merge_base_with_diff3(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "cd17a91513f3aee9e44114d1ede67932dd41d2fc", 1, "veal.txt" },
+		{ 0100644, "d604c75019c282144bdbbf3fd3462ba74b240efc", 2, "veal.txt" },
+		{ 0100644, "37a5054a9f9b4628e3924c5cb8f2147c6e2a3efc", 3, "veal.txt" },
+	};
+
+	opts.file_flags |= GIT_MERGE_FILE_STYLE_DIFF3;
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchH-1", "branchH-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	git_index_free(index);
+}
+
+/* Branch I-1 and I-2 have two common ancestors (aa9e263, 6ef31d3).  The two
+ * ancestors themselves conflict, but when each was merged, the conflicts were
+ * resolved identically, thus merging I-1 into I-2 does not conflict.
+ */
+void test_merge_trees_recursive__conflicting_merge_base_since_resolved(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "a02d4fd126e0cc8fb46ee48cf38bad36d44f2dbc", 0, "veal.txt" },
+	};
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchI-1", "branchI-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+	git_index_free(index);
+}
+
+/* There are multiple levels of criss-cross merges, and multiple recursive
+ * merges would create a common ancestor that allows the merge to complete
+ * successfully.  Test that we can build a single virtual base, then stop,
+ * which will produce a conflicting merge.
+ */
+void test_merge_trees_recursive__recursionlimit(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "ce7e553c6feb6e5f3bd67e3c3be04182fe3094b4", 1, "gravy.txt" },
+		{ 0100644, "d8dd349b78f19a4ebe3357bacb8138f00bf5ed41", 2, "gravy.txt" },
+		{ 0100644, "e50fbbd701458757bdfe9815f58ed717c588d1b5", 3, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "a7b066537e6be7109abfe4ff97b675d4e077da20", 0, "veal.txt" },
+	};
+
+	opts.recursion_limit = 1;
+
+	cl_git_pass(merge_commits_from_branches(&index, repo, "branchE-1", "branchE-2", &opts));
+
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	git_index_free(index);
+}
+
diff --git a/tests/merge/trees/treediff.c b/tests/merge/trees/treediff.c
index f21d99b..3634568 100644
--- a/tests/merge/trees/treediff.c
+++ b/tests/merge/trees/treediff.c
@@ -47,7 +47,7 @@ static void test_find_differences(
 	git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
 
 	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
-	opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.flags |= GIT_MERGE_FIND_RENAMES;
 	opts.target_limit = 1000;
 	opts.rename_threshold = 50;
 
diff --git a/tests/merge/workdir/recursive.c b/tests/merge/workdir/recursive.c
new file mode 100644
index 0000000..7951262
--- /dev/null
+++ b/tests/merge/workdir/recursive.c
@@ -0,0 +1,84 @@
+#include "clar_libgit2.h"
+#include "git2/repository.h"
+#include "git2/merge.h"
+#include "merge.h"
+#include "../merge_helpers.h"
+#include "../conflict_data.h"
+
+static git_repository *repo;
+
+#define TEST_REPO_PATH "merge-recursive"
+
+void test_merge_workdir_recursive__initialize(void)
+{
+	repo = cl_git_sandbox_init(TEST_REPO_PATH);
+}
+
+void test_merge_workdir_recursive__cleanup(void)
+{
+	cl_git_sandbox_cleanup();
+}
+
+void test_merge_workdir_recursive__writes_conflict_with_virtual_base(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+	git_buf conflicting_buf = GIT_BUF_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "fa567f568ed72157c0c617438d077695b99d9aac", 1, "veal.txt" },
+		{ 0100644, "21950d5e4e4d1a871b4dfcf72ecb6b9c162c434e", 2, "veal.txt" },
+		{ 0100644, "3855170cef875708da06ab9ad7fc6a73b531cda1", 3, "veal.txt" },
+	};
+
+	cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR "branchF-1", GIT_REFS_HEADS_DIR "branchF-2", &opts, NULL));
+
+	cl_git_pass(git_repository_index(&index, repo));
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	cl_git_pass(git_futils_readbuffer(&conflicting_buf, "merge-recursive/veal.txt"));
+
+	cl_assert_equal_s(CONFLICTING_RECURSIVE_F1_TO_F2, conflicting_buf.ptr);
+	
+	git_index_free(index);
+	git_buf_free(&conflicting_buf);
+}
+
+void test_merge_workdir_recursive__conflicting_merge_base_with_diff3(void)
+{
+	git_index *index;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+	git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
+	git_buf conflicting_buf = GIT_BUF_INIT;
+
+	struct merge_index_entry merge_index_entries[] = {
+		{ 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+		{ 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+		{ 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+		{ 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+		{ 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+		{ 0100644, "cd17a91513f3aee9e44114d1ede67932dd41d2fc", 1, "veal.txt" },
+		{ 0100644, "d604c75019c282144bdbbf3fd3462ba74b240efc", 2, "veal.txt" },
+		{ 0100644, "37a5054a9f9b4628e3924c5cb8f2147c6e2a3efc", 3, "veal.txt" },
+	};
+
+	opts.file_flags |= GIT_MERGE_FILE_STYLE_DIFF3;
+	checkout_opts.checkout_strategy |= GIT_CHECKOUT_CONFLICT_STYLE_DIFF3;
+
+	cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR "branchH-1", GIT_REFS_HEADS_DIR "branchH-2", &opts, &checkout_opts));
+
+	cl_git_pass(git_repository_index(&index, repo));
+	cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+	cl_git_pass(git_futils_readbuffer(&conflicting_buf, "merge-recursive/veal.txt"));
+
+	cl_assert_equal_s(CONFLICTING_RECURSIVE_H1_TO_H2_WITH_DIFF3, conflicting_buf.ptr);
+
+	git_index_free(index);
+	git_buf_free(&conflicting_buf);
+}
diff --git a/tests/merge/workdir/renames.c b/tests/merge/workdir/renames.c
index 83006a7..fabcda2 100644
--- a/tests/merge/workdir/renames.c
+++ b/tests/merge/workdir/renames.c
@@ -63,7 +63,7 @@ void test_merge_workdir_renames__renames(void)
 		{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 0, "7-both-renamed.txt~rename_conflict_theirs" },
 	};
 
-	merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
 	merge_opts.rename_threshold = 50;
 
 	cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR BRANCH_RENAME_OURS, GIT_REFS_HEADS_DIR BRANCH_RENAME_THEIRS, &merge_opts, NULL));
@@ -99,7 +99,7 @@ void test_merge_workdir_renames__ours(void)
 		{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 0, "7-both-renamed.txt" },
 	};
 
-	merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
 	merge_opts.rename_threshold = 50;
 	checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS;
 
@@ -147,7 +147,7 @@ void test_merge_workdir_renames__similar(void)
 		{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 0, "7-both-renamed.txt~rename_conflict_theirs" },
 	};
 
-	merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
 	merge_opts.rename_threshold = 50;
 
 	cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR BRANCH_RENAME_OURS, GIT_REFS_HEADS_DIR BRANCH_RENAME_THEIRS, &merge_opts, NULL));
diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c
index abc0777..3cdd15b 100644
--- a/tests/merge/workdir/simple.c
+++ b/tests/merge/workdir/simple.c
@@ -4,6 +4,7 @@
 #include "buffer.h"
 #include "merge.h"
 #include "../merge_helpers.h"
+#include "../conflict_data.h"
 #include "refs.h"
 #include "fileops.h"
 
diff --git a/tests/resources/merge-recursive/.gitted/HEAD b/tests/resources/merge-recursive/.gitted/HEAD
new file mode 100644
index 0000000..d7cef11
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/HEAD
@@ -0,0 +1 @@
+ref: refs/heads/branchG-2
diff --git a/tests/resources/merge-recursive/.gitted/config b/tests/resources/merge-recursive/.gitted/config
new file mode 100644
index 0000000..6c9406b
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/config
@@ -0,0 +1,7 @@
+[core]
+	repositoryformatversion = 0
+	filemode = true
+	bare = false
+	logallrefupdates = true
+	ignorecase = true
+	precomposeunicode = true
diff --git a/tests/resources/merge-recursive/.gitted/index b/tests/resources/merge-recursive/.gitted/index
new file mode 100644
index 0000000..571cfd0
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/index differ
diff --git a/tests/resources/merge-recursive/.gitted/info/refs b/tests/resources/merge-recursive/.gitted/info/refs
new file mode 100644
index 0000000..96482e6
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/info/refs
@@ -0,0 +1 @@
+7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f	refs/heads/master
diff --git a/tests/resources/merge-recursive/.gitted/objects/00/6b298c5702b04c00370d0414959765b82fd722 b/tests/resources/merge-recursive/.gitted/objects/00/6b298c5702b04c00370d0414959765b82fd722
new file mode 100644
index 0000000..d3fb85f
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/00/6b298c5702b04c00370d0414959765b82fd722 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/00/7f1ee2af8e5d99906867c4237510e1790a89b8 b/tests/resources/merge-recursive/.gitted/objects/00/7f1ee2af8e5d99906867c4237510e1790a89b8
new file mode 100644
index 0000000..d9399d7
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/00/7f1ee2af8e5d99906867c4237510e1790a89b8
@@ -0,0 +1,3 @@
+xNI
+1<FtgA<zY:LFBjj-I]߈fah
+R)<+΅sZd8Fkg$RQqe!&ZgRg_.nK
N
~j[=2ց28;vsfTrqa<
`bQ
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/01/6eef4a6fefd36bdcaa93ad773449ddc5c73cbb b/tests/resources/merge-recursive/.gitted/objects/01/6eef4a6fefd36bdcaa93ad773449ddc5c73cbb
new file mode 100644
index 0000000..9008584
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/01/6eef4a6fefd36bdcaa93ad773449ddc5c73cbb differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/05/c6a04ac101ab1a9836a95d5ec8d16b6f6304fd b/tests/resources/merge-recursive/.gitted/objects/05/c6a04ac101ab1a9836a95d5ec8d16b6f6304fd
new file mode 100644
index 0000000..c6a3a3b
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/05/c6a04ac101ab1a9836a95d5ec8d16b6f6304fd differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/06/db153c36829fc656e05cdf5a3bf7183f3c10aa b/tests/resources/merge-recursive/.gitted/objects/06/db153c36829fc656e05cdf5a3bf7183f3c10aa
new file mode 100644
index 0000000..85887e0
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/06/db153c36829fc656e05cdf5a3bf7183f3c10aa
@@ -0,0 +1,2 @@
+x%Pn@|_HN.}%)Qe819@R$&I!w6pF,Kң*HL
s߯#0+300/`#Cib']l
+RRqo,k>\vXɸPzIIM6iY],WzpBzPdF4V.xV!y~9ր0uhoU`$,_R:-a2%Sw^cJ>fFOv;+
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/07/10c3c796e0704361472ecb904413fca0107a25 b/tests/resources/merge-recursive/.gitted/objects/07/10c3c796e0704361472ecb904413fca0107a25
new file mode 100644
index 0000000..9f48594
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/07/10c3c796e0704361472ecb904413fca0107a25 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/07/2d89dcf3a7671ac34a8e875bb72fb39bcf14d7 b/tests/resources/merge-recursive/.gitted/objects/07/2d89dcf3a7671ac34a8e875bb72fb39bcf14d7
new file mode 100644
index 0000000..69104c9
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/07/2d89dcf3a7671ac34a8e875bb72fb39bcf14d7 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/0b/b7ed583d7e9ad507e8b902594f5c9126ea456b b/tests/resources/merge-recursive/.gitted/objects/0b/b7ed583d7e9ad507e8b902594f5c9126ea456b
new file mode 100644
index 0000000..e7b4ba1
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/0b/b7ed583d7e9ad507e8b902594f5c9126ea456b differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/0e/8126647ec607f0a14122cec4b15315d790c8ff b/tests/resources/merge-recursive/.gitted/objects/0e/8126647ec607f0a14122cec4b15315d790c8ff
new file mode 100644
index 0000000..c99a686
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/0e/8126647ec607f0a14122cec4b15315d790c8ff differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/0f/a6ead2731b9d138afe38c336c9727ea05027a7 b/tests/resources/merge-recursive/.gitted/objects/0f/a6ead2731b9d138afe38c336c9727ea05027a7
new file mode 100644
index 0000000..b06362d
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/0f/a6ead2731b9d138afe38c336c9727ea05027a7
@@ -0,0 +1 @@
+xJAE+*hk"bhTw8̴-\0/2<݌nKI\9D`5Tdϩ4JmI)ꈼ"-鄱晴O'„3YG	JAXSd#(NPxzmpg{q>e9ѱsӞ3=Y1pFe2oz
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/12/4d4fe29d3433fdaa2f0f455d226f2c79d89cf3 b/tests/resources/merge-recursive/.gitted/objects/12/4d4fe29d3433fdaa2f0f455d226f2c79d89cf3
new file mode 100644
index 0000000..f0ea020
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/12/4d4fe29d3433fdaa2f0f455d226f2c79d89cf3 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/15/311229e70fa62653f73dde1d4deef1a8e47a11 b/tests/resources/merge-recursive/.gitted/objects/15/311229e70fa62653f73dde1d4deef1a8e47a11
new file mode 100644
index 0000000..8c21bb3
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/15/311229e70fa62653f73dde1d4deef1a8e47a11 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/15/faa0c9991f2d65686e844651faa2ff9827887b b/tests/resources/merge-recursive/.gitted/objects/15/faa0c9991f2d65686e844651faa2ff9827887b
new file mode 100644
index 0000000..54cd6f2
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/15/faa0c9991f2d65686e844651faa2ff9827887b differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/16/895aa5e13f8907d4adab81285557d938fad342 b/tests/resources/merge-recursive/.gitted/objects/16/895aa5e13f8907d4adab81285557d938fad342
new file mode 100644
index 0000000..4d3319b
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/16/895aa5e13f8907d4adab81285557d938fad342 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175 b/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175
new file mode 100644
index 0000000..a214649
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/1e/8dff96faaaa24f84943d2d9601dde61cb0398a b/tests/resources/merge-recursive/.gitted/objects/1e/8dff96faaaa24f84943d2d9601dde61cb0398a
new file mode 100644
index 0000000..b6185f2
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/1e/8dff96faaaa24f84943d2d9601dde61cb0398a differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/21/950d5e4e4d1a871b4dfcf72ecb6b9c162c434e b/tests/resources/merge-recursive/.gitted/objects/21/950d5e4e4d1a871b4dfcf72ecb6b9c162c434e
new file mode 100644
index 0000000..a877326
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/21/950d5e4e4d1a871b4dfcf72ecb6b9c162c434e differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/34/8f16ffaeb73f319a75cec5b16a0a47d2d5e27c b/tests/resources/merge-recursive/.gitted/objects/34/8f16ffaeb73f319a75cec5b16a0a47d2d5e27c
new file mode 100644
index 0000000..bd1b1f6
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/34/8f16ffaeb73f319a75cec5b16a0a47d2d5e27c differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/37/185b25a204309bf74817da1a607518f13ca3ed b/tests/resources/merge-recursive/.gitted/objects/37/185b25a204309bf74817da1a607518f13ca3ed
new file mode 100644
index 0000000..a8cf005
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/37/185b25a204309bf74817da1a607518f13ca3ed differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/37/a5054a9f9b4628e3924c5cb8f2147c6e2a3efc b/tests/resources/merge-recursive/.gitted/objects/37/a5054a9f9b4628e3924c5cb8f2147c6e2a3efc
new file mode 100644
index 0000000..4591f0e
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/37/a5054a9f9b4628e3924c5cb8f2147c6e2a3efc differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/38/55170cef875708da06ab9ad7fc6a73b531cda1 b/tests/resources/merge-recursive/.gitted/objects/38/55170cef875708da06ab9ad7fc6a73b531cda1
new file mode 100644
index 0000000..7da945e
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/38/55170cef875708da06ab9ad7fc6a73b531cda1 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/3a/3f5a6ec1c968d1d2d5d20dee0d161a4351f279 b/tests/resources/merge-recursive/.gitted/objects/3a/3f5a6ec1c968d1d2d5d20dee0d161a4351f279
new file mode 100644
index 0000000..f39a127
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/3a/3f5a6ec1c968d1d2d5d20dee0d161a4351f279
@@ -0,0 +1 @@
+xO
!*h@Bb?ׁ
Xr&a}؁LfR]KqQ{	`Ozɚtɤk(gؓ+*+X[F8>EGkS~y˽CۥB4ƀNnPֈ)OWN:
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/3b/919b6e8a575b4779c8243ebea3e3beb436e88f b/tests/resources/merge-recursive/.gitted/objects/3b/919b6e8a575b4779c8243ebea3e3beb436e88f
new file mode 100644
index 0000000..c85731d
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/3b/919b6e8a575b4779c8243ebea3e3beb436e88f differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/3f/d41804a7906db846af5e868444782e546af46a b/tests/resources/merge-recursive/.gitted/objects/3f/d41804a7906db846af5e868444782e546af46a
new file mode 100644
index 0000000..4915b86
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/3f/d41804a7906db846af5e868444782e546af46a differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78 b/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78
new file mode 100644
index 0000000..5dc102d
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/42/1b392106e079df6d412babd5636697938269ec b/tests/resources/merge-recursive/.gitted/objects/42/1b392106e079df6d412babd5636697938269ec
new file mode 100644
index 0000000..3a8324c
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/42/1b392106e079df6d412babd5636697938269ec
@@ -0,0 +1,2 @@
+xQ
+0D)re7D
@ݥmFU3o`)u.zM[Dӽ,PH^w*)c&6,27JJADQ&KN)bT3<XkX؞:lҏ:7]:v`Vmgyj=O
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/42/44d13e2bbc38510320443bbb003f3967d12436 b/tests/resources/merge-recursive/.gitted/objects/42/44d13e2bbc38510320443bbb003f3967d12436
new file mode 100644
index 0000000..a19b191
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/42/44d13e2bbc38510320443bbb003f3967d12436 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/42/cdad903aef3e7b614675e6584a8be417941911 b/tests/resources/merge-recursive/.gitted/objects/42/cdad903aef3e7b614675e6584a8be417941911
new file mode 100644
index 0000000..99b5e6d
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/42/cdad903aef3e7b614675e6584a8be417941911 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/43/2faca0c62dc556ad71a22f23e541a46a8b0f6f b/tests/resources/merge-recursive/.gitted/objects/43/2faca0c62dc556ad71a22f23e541a46a8b0f6f
new file mode 100644
index 0000000..ff18f0e
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/43/2faca0c62dc556ad71a22f23e541a46a8b0f6f
@@ -0,0 +1,2 @@
+x+)JMU022g040031QH,.H,JL/-+(a9/>~WENYZGj
+RSj2I^'y51i0599`e5az%潎U^XV	Vtٙo]2Y~P1($bz7g\QdLɔ3Rsj/]3VLlg{W[
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/43/5424798e5e1b21dd4588d1c291ba4eb179a838 b/tests/resources/merge-recursive/.gitted/objects/43/5424798e5e1b21dd4588d1c291ba4eb179a838
new file mode 100644
index 0000000..58ab239
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/43/5424798e5e1b21dd4588d1c291ba4eb179a838 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/43/6ea75c99f527e4b42fddb46abedf7726eb719d b/tests/resources/merge-recursive/.gitted/objects/43/6ea75c99f527e4b42fddb46abedf7726eb719d
new file mode 100644
index 0000000..e8825d8
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/43/6ea75c99f527e4b42fddb46abedf7726eb719d
@@ -0,0 +1,2 @@
+xKj1D)tncev@bFf,G	U(i۶v}CՂft1RRf`$tNTcy6>t]Rǐ!=@̱T\
+ǔW_aGm϶۳WOi"Q%	:v}s|Ϋp_Dž7QA
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/48/3065df53c0f4a02cdc6b2910b05d388fc17ffb b/tests/resources/merge-recursive/.gitted/objects/48/3065df53c0f4a02cdc6b2910b05d388fc17ffb
new file mode 100644
index 0000000..298251b
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/48/3065df53c0f4a02cdc6b2910b05d388fc17ffb differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/4b/7c5650008b2e747fe1809eeb5a1dde0e80850a b/tests/resources/merge-recursive/.gitted/objects/4b/7c5650008b2e747fe1809eeb5a1dde0e80850a
new file mode 100644
index 0000000..0163985
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/4b/7c5650008b2e747fe1809eeb5a1dde0e80850a differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/4c/49317a0912ca559d2048bc329994eb7d10474f b/tests/resources/merge-recursive/.gitted/objects/4c/49317a0912ca559d2048bc329994eb7d10474f
new file mode 100644
index 0000000..d7bb4d3
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/4c/49317a0912ca559d2048bc329994eb7d10474f differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/4d/fc1be85a9d6c9898152444d32b238b4aecf8cc b/tests/resources/merge-recursive/.gitted/objects/4d/fc1be85a9d6c9898152444d32b238b4aecf8cc
new file mode 100644
index 0000000..9db684d
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/4d/fc1be85a9d6c9898152444d32b238b4aecf8cc differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/4e/21d2d63357bde5027d1625f5ec6b430cdeb143 b/tests/resources/merge-recursive/.gitted/objects/4e/21d2d63357bde5027d1625f5ec6b430cdeb143
new file mode 100644
index 0000000..34f183d
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/4e/21d2d63357bde5027d1625f5ec6b430cdeb143 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/4e/70a6b06fc62481f80fbb74327849e7170eebff b/tests/resources/merge-recursive/.gitted/objects/4e/70a6b06fc62481f80fbb74327849e7170eebff
new file mode 100644
index 0000000..1dfcec5
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/4e/70a6b06fc62481f80fbb74327849e7170eebff differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/4f/4e85a0ab8515e34302721fbcec06fa9d9c1a9a b/tests/resources/merge-recursive/.gitted/objects/4f/4e85a0ab8515e34302721fbcec06fa9d9c1a9a
new file mode 100644
index 0000000..4752ea0
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/4f/4e85a0ab8515e34302721fbcec06fa9d9c1a9a differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/50/e4facaafb746cfed89287206274193c1417288 b/tests/resources/merge-recursive/.gitted/objects/50/e4facaafb746cfed89287206274193c1417288
new file mode 100644
index 0000000..b1eaee5
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/50/e4facaafb746cfed89287206274193c1417288
@@ -0,0 +1,2 @@
+x+)JMU022g040031QH,.H,JL/-+(a9/>~WENYZGj
+RSj2I^'y51i0599`e5az%潎U^XV	Vtٙo]2Y~P1($bz7g\QdLɔ3RsjD-89S^75#-ע3;\
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/53/9bd011c4822c560c1d17cab095006b7a10f707 b/tests/resources/merge-recursive/.gitted/objects/53/9bd011c4822c560c1d17cab095006b7a10f707
new file mode 100644
index 0000000..3fa1e1f
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/53/9bd011c4822c560c1d17cab095006b7a10f707 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/56/07a8c4601a737daadd1f470bde3142aff57026 b/tests/resources/merge-recursive/.gitted/objects/56/07a8c4601a737daadd1f470bde3142aff57026
new file mode 100644
index 0000000..bf3639d
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/56/07a8c4601a737daadd1f470bde3142aff57026
@@ -0,0 +1 @@
+xMJ1])#?<čp:3w=Ԧ((~`MxCrBYMSP-}tjzL`JRvRjBV8Ze&6zsTr͵̍2.9>~I~Gs1G!j1IcS1xW(܎u#rbV
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/5a/ba269b3be41fc8db38068d3948c8af543fe609 b/tests/resources/merge-recursive/.gitted/objects/5a/ba269b3be41fc8db38068d3948c8af543fe609
new file mode 100644
index 0000000..85bc8f5
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/5a/ba269b3be41fc8db38068d3948c8af543fe609 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/5b/8e1e56cb99e8b99ac22eec8aebf6422ecd08c0 b/tests/resources/merge-recursive/.gitted/objects/5b/8e1e56cb99e8b99ac22eec8aebf6422ecd08c0
new file mode 100644
index 0000000..c3e6d31
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/5b/8e1e56cb99e8b99ac22eec8aebf6422ecd08c0 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/5e/8747f5200fac0f945a07daf6163ca9cb1a8da9 b/tests/resources/merge-recursive/.gitted/objects/5e/8747f5200fac0f945a07daf6163ca9cb1a8da9
new file mode 100644
index 0000000..fa1c9e5
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/5e/8747f5200fac0f945a07daf6163ca9cb1a8da9 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/5f/18576d464946eb2338daeb8b4030019961f505 b/tests/resources/merge-recursive/.gitted/objects/5f/18576d464946eb2338daeb8b4030019961f505
new file mode 100644
index 0000000..d03742b
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/5f/18576d464946eb2338daeb8b4030019961f505 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/63/e8773becdea9c3699c95a5740be5baa8be8d69 b/tests/resources/merge-recursive/.gitted/objects/63/e8773becdea9c3699c95a5740be5baa8be8d69
new file mode 100644
index 0000000..6d5c320
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/63/e8773becdea9c3699c95a5740be5baa8be8d69 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/65/bea8448ca5b3104628ffbca553c54bde54b0fc b/tests/resources/merge-recursive/.gitted/objects/65/bea8448ca5b3104628ffbca553c54bde54b0fc
new file mode 100644
index 0000000..031c913
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/65/bea8448ca5b3104628ffbca553c54bde54b0fc
@@ -0,0 +1,3 @@
+x
!D
+а,3 jyL^\6h9qDLɒ~
+
F'Qk$<
!!2eְazlH}MEy^~Qïr-
n`[Q+]eyBWyM
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/66/6ffdfcf1eaa5641fa31064bf2607327e843c09 b/tests/resources/merge-recursive/.gitted/objects/66/6ffdfcf1eaa5641fa31064bf2607327e843c09
new file mode 100644
index 0000000..8d6be42
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/66/6ffdfcf1eaa5641fa31064bf2607327e843c09 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370 b/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370
new file mode 100644
index 0000000..6d7c948
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/68/af1fc7407fd9addf1701a87eb1c95c7494c598 b/tests/resources/merge-recursive/.gitted/objects/68/af1fc7407fd9addf1701a87eb1c95c7494c598
new file mode 100644
index 0000000..6aaf79f
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/68/af1fc7407fd9addf1701a87eb1c95c7494c598 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/68/f6182f4c85d39e1309d97c7e456156dc9c0096 b/tests/resources/merge-recursive/.gitted/objects/68/f6182f4c85d39e1309d97c7e456156dc9c0096
new file mode 100644
index 0000000..ed1de3a
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/68/f6182f4c85d39e1309d97c7e456156dc9c0096 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/6c/778edd0e4cf394f5a3df8b96db516024cc1bb8 b/tests/resources/merge-recursive/.gitted/objects/6c/778edd0e4cf394f5a3df8b96db516024cc1bb8
new file mode 100644
index 0000000..ec1db19
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/6c/778edd0e4cf394f5a3df8b96db516024cc1bb8 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/6e/f31d35a3f5abc1e24f4f9afa5cb2016f03fa2d b/tests/resources/merge-recursive/.gitted/objects/6e/f31d35a3f5abc1e24f4f9afa5cb2016f03fa2d
new file mode 100644
index 0000000..e95a5e2
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/6e/f31d35a3f5abc1e24f4f9afa5cb2016f03fa2d
@@ -0,0 +1 @@
+xAN!]sahcx$2gpWE:z8‡5UA-YG
zAl+&LLd>cW.-&͊)BI5o&p<gq/`n,<"!^C#anr]]Bɧ_*PV
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/71/3e438567b28543235faf265c4c5b02b437c7fd b/tests/resources/merge-recursive/.gitted/objects/71/3e438567b28543235faf265c4c5b02b437c7fd
new file mode 100644
index 0000000..8b1f688
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/71/3e438567b28543235faf265c4c5b02b437c7fd differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/72/3181f1bfd30e47a6d1d36a4d874e31e7a0a1a4 b/tests/resources/merge-recursive/.gitted/objects/72/3181f1bfd30e47a6d1d36a4d874e31e7a0a1a4
new file mode 100644
index 0000000..01d113e
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/72/3181f1bfd30e47a6d1d36a4d874e31e7a0a1a4
@@ -0,0 +1,2 @@
+x[
+1E*Ağفȴ)#8SUowDž.˥E8Bt6'<`bvh=I_ԍD)Bq}D	)z6Z\{]B?Չ_Ku9Atl5jQcOznO6
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/73/b20c8e09fa2726d69ff66969186014165da3c3 b/tests/resources/merge-recursive/.gitted/objects/73/b20c8e09fa2726d69ff66969186014165da3c3
new file mode 100644
index 0000000..6559958
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/73/b20c8e09fa2726d69ff66969186014165da3c3 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/74/4df1bdf0f7bca20deb23e5a5eb8255fc237901 b/tests/resources/merge-recursive/.gitted/objects/74/4df1bdf0f7bca20deb23e5a5eb8255fc237901
new file mode 100644
index 0000000..c05cdad
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/74/4df1bdf0f7bca20deb23e5a5eb8255fc237901 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/75/c653822173a8e5795153ec3773dfe44bb9bb63 b/tests/resources/merge-recursive/.gitted/objects/75/c653822173a8e5795153ec3773dfe44bb9bb63
new file mode 100644
index 0000000..1495f70
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/75/c653822173a8e5795153ec3773dfe44bb9bb63
@@ -0,0 +1 @@
+xJ1);ՑLfrYdfSFbwヿm@WcRyh5V<H}@,3NFhI^-ŤuDA"1y!-N6Aߥ+<m{m;ؑ~;*~um- sȳwٱsӑ3=Z6NpGeOp<
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/78/3d6539dde96b8873c5b5da3e79cc14cd64830b b/tests/resources/merge-recursive/.gitted/objects/78/3d6539dde96b8873c5b5da3e79cc14cd64830b
new file mode 100644
index 0000000..e2f34d6
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/78/3d6539dde96b8873c5b5da3e79cc14cd64830b
@@ -0,0 +1,4 @@
+xk
+0S*y4/DO6ٍ-Fj[ofrvrf(G"IAq\H޳,٢r1%Xt R
+Z6g'zBp3xuos\=18#tJ)Vmg8ֹ
+L8wZU
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/7a/9277e0c5ec75339f011c176d0c20e513c4de1c b/tests/resources/merge-recursive/.gitted/objects/7a/9277e0c5ec75339f011c176d0c20e513c4de1c
new file mode 100644
index 0000000..9fb34f7
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/7a/9277e0c5ec75339f011c176d0c20e513c4de1c
@@ -0,0 +1 @@
+xOANE!sN>1nLܸ0ނcnڦiSӠwsP!gwaZB,CiB@HT԰P(g@(*h7+,N*ĕd.5P6{|(mOaOo{8"Pbrױ^uɃO_.`s?o0Xa
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/7c/7bf85e978f1d18c0566f702d2cb7766b9c8d4f b/tests/resources/merge-recursive/.gitted/objects/7c/7bf85e978f1d18c0566f702d2cb7766b9c8d4f
new file mode 100644
index 0000000..fe8b157
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/7c/7bf85e978f1d18c0566f702d2cb7766b9c8d4f
@@ -0,0 +1 @@
+xN0Dd'	\V\~/1rw5m|0tntƺ%kcnua:K,^W55<i:q^33qe\ ӝKR
&ڡȶJ,Nי#|VhNwDžԙԺ{Y}RYa)
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/7c/7e08f9559d9e1551b91e1cf68f1d0066109add b/tests/resources/merge-recursive/.gitted/objects/7c/7e08f9559d9e1551b91e1cf68f1d0066109add
new file mode 100644
index 0000000..48d22f6
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/7c/7e08f9559d9e1551b91e1cf68f1d0066109add differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 b/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0
new file mode 100644
index 0000000..c4b8355
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 b/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340
new file mode 100644
index 0000000..12eb066
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340
@@ -0,0 +1,5 @@
+xK
+1D]}|:
@`Hx}G^ARw32t99^e/sFǙId9{ 5^kE&x4[e
'Cd̈11:#sZ
+}G[_ۧVUD)F7ވږK
+l
+e6Rb
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/88/8588a782ad433fbf0cc526e07cfe6f4a6b60b3 b/tests/resources/merge-recursive/.gitted/objects/88/8588a782ad433fbf0cc526e07cfe6f4a6b60b3
new file mode 100644
index 0000000..44efd33
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/88/8588a782ad433fbf0cc526e07cfe6f4a6b60b3 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/88/eb3f98849f4b8d0555395f514800900a01dc8f b/tests/resources/merge-recursive/.gitted/objects/88/eb3f98849f4b8d0555395f514800900a01dc8f
new file mode 100644
index 0000000..41c812f
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/88/eb3f98849f4b8d0555395f514800900a01dc8f differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/89/8d12687fb35be271c27c795a6b32c8b51da79e b/tests/resources/merge-recursive/.gitted/objects/89/8d12687fb35be271c27c795a6b32c8b51da79e
new file mode 100644
index 0000000..2ce4f7f
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/89/8d12687fb35be271c27c795a6b32c8b51da79e differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/8a/bda8de114a93f2d3c5a975ee2960f31e24be58 b/tests/resources/merge-recursive/.gitted/objects/8a/bda8de114a93f2d3c5a975ee2960f31e24be58
new file mode 100644
index 0000000..a03624d
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/8a/bda8de114a93f2d3c5a975ee2960f31e24be58
@@ -0,0 +1,2 @@
+xN;
+1)r"6[y"Y#^(@b>0j-+k}'⤒#(,HmK 2
ZNǝ=%!QEa^p޹% $Y||N'~[[}hvoSGl̥1I!pNΰkK%
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/8f/35f30bfe09513f96cf8aa4df0834ae34e93bae b/tests/resources/merge-recursive/.gitted/objects/8f/35f30bfe09513f96cf8aa4df0834ae34e93bae
new file mode 100644
index 0000000..1011a88
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/8f/35f30bfe09513f96cf8aa4df0834ae34e93bae
@@ -0,0 +1 @@
+xO	1*ҀfAv`̄\#1jFo뺞4mzcl&toQ	*p:9qK])BѤ!+Bʐc8e WDz69+5z{k. sgV9Pƈ'xxO
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/94/d2c01087f48213bd157222d54edfefd77c9bba b/tests/resources/merge-recursive/.gitted/objects/94/d2c01087f48213bd157222d54edfefd77c9bba
new file mode 100644
index 0000000..76ffe4e
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/94/d2c01087f48213bd157222d54edfefd77c9bba differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/95/78b04e2087976e382622322ba476aa40398dc7 b/tests/resources/merge-recursive/.gitted/objects/95/78b04e2087976e382622322ba476aa40398dc7
new file mode 100644
index 0000000..e3d15aa
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/95/78b04e2087976e382622322ba476aa40398dc7 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/96/23368f0fc562d6d840372ae17dc4cc32d51a80 b/tests/resources/merge-recursive/.gitted/objects/96/23368f0fc562d6d840372ae17dc4cc32d51a80
new file mode 100644
index 0000000..70bf8fb
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/96/23368f0fc562d6d840372ae17dc4cc32d51a80
@@ -0,0 +1,2 @@
+xK
+1D]H>πYId1oo ԢuJ7"BthuՊ2ypH@bhܡ2IXPIat8OYx6Whֺ=O4][vH| tTr˸0L#S;
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/97/3b70322e758da87e1ce21d2195d86c5e4e9647 b/tests/resources/merge-recursive/.gitted/objects/97/3b70322e758da87e1ce21d2195d86c5e4e9647
new file mode 100644
index 0000000..a90a61c
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/97/3b70322e758da87e1ce21d2195d86c5e4e9647
@@ -0,0 +1 @@
+xN1)]u^!NDI8^[z$&u7{7fBD{Rr(䓯2jmL9AHI.TT
s
TY6۾]{祭׶Ɇns[(pD8
w5ӓ68u. up`p3
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/98/1c79eb38518d3821e73bb159dc413bb42d6614 b/tests/resources/merge-recursive/.gitted/objects/98/1c79eb38518d3821e73bb159dc413bb42d6614
new file mode 100644
index 0000000..d5787b4
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/98/1c79eb38518d3821e73bb159dc413bb42d6614 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/9a/e63b4a8ce0f181b2d1d098971733a103226917 b/tests/resources/merge-recursive/.gitted/objects/9a/e63b4a8ce0f181b2d1d098971733a103226917
new file mode 100644
index 0000000..0cbd00d
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/9a/e63b4a8ce0f181b2d1d098971733a103226917 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 b/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85
new file mode 100644
index 0000000..305e1f3
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/9c/3f1c70db28c00ce74b22ba3edafe16d9cf03d4 b/tests/resources/merge-recursive/.gitted/objects/9c/3f1c70db28c00ce74b22ba3edafe16d9cf03d4
new file mode 100644
index 0000000..b0ef1af
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/9c/3f1c70db28c00ce74b22ba3edafe16d9cf03d4 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/9e/12bce04446d097ae1782967a5888c2e2a0d35b b/tests/resources/merge-recursive/.gitted/objects/9e/12bce04446d097ae1782967a5888c2e2a0d35b
new file mode 100644
index 0000000..0940d09
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/9e/12bce04446d097ae1782967a5888c2e2a0d35b differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/a0/2d4fd126e0cc8fb46ee48cf38bad36d44f2dbc b/tests/resources/merge-recursive/.gitted/objects/a0/2d4fd126e0cc8fb46ee48cf38bad36d44f2dbc
new file mode 100644
index 0000000..5669767
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/a0/2d4fd126e0cc8fb46ee48cf38bad36d44f2dbc differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/a0/65d3022e99a1943177c10a53cce38bc2127042 b/tests/resources/merge-recursive/.gitted/objects/a0/65d3022e99a1943177c10a53cce38bc2127042
new file mode 100644
index 0000000..d14b739
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/a0/65d3022e99a1943177c10a53cce38bc2127042 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/a2/8c21c90aa36580641b345011869d1a899a6783 b/tests/resources/merge-recursive/.gitted/objects/a2/8c21c90aa36580641b345011869d1a899a6783
new file mode 100644
index 0000000..91ffb4b
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/a2/8c21c90aa36580641b345011869d1a899a6783
@@ -0,0 +1,2 @@
+xN@ۥ:\Ix^dQ	WDg3i\<7le*MbB0	Ji%XTUV[6CԠՔQR0ZjB/TD	OmDr%
bxR>
+jra,hWwY=wo;[nk1'D1Ó/~xmrrmѝROa
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/a2/fa36ffc4a565a223e225d15b18774f87d0c4f0 b/tests/resources/merge-recursive/.gitted/objects/a2/fa36ffc4a565a223e225d15b18774f87d0c4f0
new file mode 100644
index 0000000..3471394
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/a2/fa36ffc4a565a223e225d15b18774f87d0c4f0
@@ -0,0 +1,3 @@
+xA D]s
+.Cbc]LfRG¡P9Ѣ%@k0L
bӡ/W^ĄT倾yIY
+*u"Dd("m+Yަ:ougG]~|@)>5brx7Q
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/a3/4e5a16feabbd0335a633aadb8217c9f3dba58d b/tests/resources/merge-recursive/.gitted/objects/a3/4e5a16feabbd0335a633aadb8217c9f3dba58d
new file mode 100644
index 0000000..00f9c2d
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/a3/4e5a16feabbd0335a633aadb8217c9f3dba58d differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/a7/b066537e6be7109abfe4ff97b675d4e077da20 b/tests/resources/merge-recursive/.gitted/objects/a7/b066537e6be7109abfe4ff97b675d4e077da20
new file mode 100644
index 0000000..54f9b66
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/a7/b066537e6be7109abfe4ff97b675d4e077da20 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/a8/2a121ea36b115548d6dad2cd86ec27f06f7b30 b/tests/resources/merge-recursive/.gitted/objects/a8/2a121ea36b115548d6dad2cd86ec27f06f7b30
new file mode 100644
index 0000000..e740872
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/a8/2a121ea36b115548d6dad2cd86ec27f06f7b30 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/aa/9e263294fd2f6f6fd9ceab23ca8ce3ea2ce707 b/tests/resources/merge-recursive/.gitted/objects/aa/9e263294fd2f6f6fd9ceab23ca8ce3ea2ce707
new file mode 100644
index 0000000..0ec6cd8
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/aa/9e263294fd2f6f6fd9ceab23ca8ce3ea2ce707 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/ad/1ea02c2cc4f55c1dff87b80a086206a73885eb b/tests/resources/merge-recursive/.gitted/objects/ad/1ea02c2cc4f55c1dff87b80a086206a73885eb
new file mode 100644
index 0000000..99207a9
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/ad/1ea02c2cc4f55c1dff87b80a086206a73885eb
@@ -0,0 +1,2 @@
+x+)JMU022g040031QH,.H,JL/-+(a9/>~WENYZGj
+RSj2I^'y51i0599`e5az%潎U^XV	Vtٙo]2Y~P1($bz7g\QdLɔ3Rsjݿ*~뛘R+<[{
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 b/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6
new file mode 100644
index 0000000..8ae3ba5
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/ad/98bfa4679fb00b89207a0a11b8bbf91a3e4de9 b/tests/resources/merge-recursive/.gitted/objects/ad/98bfa4679fb00b89207a0a11b8bbf91a3e4de9
new file mode 100644
index 0000000..457f9da
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/ad/98bfa4679fb00b89207a0a11b8bbf91a3e4de9 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/b2/a81ead9e722af0099fccfb478cea88eea749a2 b/tests/resources/merge-recursive/.gitted/objects/b2/a81ead9e722af0099fccfb478cea88eea749a2
new file mode 100644
index 0000000..7a8ffe5
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/b2/a81ead9e722af0099fccfb478cea88eea749a2 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/b4/cefb3c75770e57bb8bb44e4a50d9578009e847 b/tests/resources/merge-recursive/.gitted/objects/b4/cefb3c75770e57bb8bb44e4a50d9578009e847
new file mode 100644
index 0000000..836bb4e
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/b4/cefb3c75770e57bb8bb44e4a50d9578009e847 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/b9/1ef5ffa8612616c8e76051901caafd723f0e2c b/tests/resources/merge-recursive/.gitted/objects/b9/1ef5ffa8612616c8e76051901caafd723f0e2c
new file mode 100644
index 0000000..e196523
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/b9/1ef5ffa8612616c8e76051901caafd723f0e2c differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/bd/97980c22d122509cdd915fd9788d56c8d3ae20 b/tests/resources/merge-recursive/.gitted/objects/bd/97980c22d122509cdd915fd9788d56c8d3ae20
new file mode 100644
index 0000000..71295e0
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/bd/97980c22d122509cdd915fd9788d56c8d3ae20 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e b/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e
new file mode 100644
index 0000000..3dde6c2
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb b/tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb
new file mode 100644
index 0000000..643a982
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb
@@ -0,0 +1 @@
+xPKN@cS̮d#!+v\ d[E}E\`۱lɼ-0.cW5熱5Қ\sX(V#$V;g1Hy±ڂP!HmzXb-X \^)\+15WP!g`JHw~Uy㘷<'b^m9oӮ~y\-o˽AdC2}C3g3	GCq;zl<{
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/c4/e6cca3ec6ae0148ed231f97257df8c311e015f b/tests/resources/merge-recursive/.gitted/objects/c4/e6cca3ec6ae0148ed231f97257df8c311e015f
new file mode 100644
index 0000000..2bbf28f
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/c4/e6cca3ec6ae0148ed231f97257df8c311e015f
@@ -0,0 +1 @@
+x%P1n0WCNEN7:*pԒ/WmI$=^^._?~|C6yTȄA(#1e鴓.(Hto@̸K-as1r6)&)8ŷTa<0ׇJ٢[K5IJcq͓쌫r_ۇ"u^@7~X)2	G,fR`B43vQH֩uab SwcJq)fƔOv;
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2 b/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2
new file mode 100644
index 0000000..0dd861f
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/ca/49d1a8b6116ffeba22667bba265fa5261df7ab b/tests/resources/merge-recursive/.gitted/objects/ca/49d1a8b6116ffeba22667bba265fa5261df7ab
new file mode 100644
index 0000000..1ea5967
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/ca/49d1a8b6116ffeba22667bba265fa5261df7ab
@@ -0,0 +1,2 @@
+xN1D+8q^BH:{ݠ^=gFھ_8FWo*s]#ZR)Zl$N0ڔzbY4+
+VCE9>_=$#)hDf#fN-őYmlCy^ikk;F'Twel[@"2Yp6d2,71ˣg48	.hv>d?;No
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/ca/7d316d6d9af99d2481e980d68b77e572d80fe7 b/tests/resources/merge-recursive/.gitted/objects/ca/7d316d6d9af99d2481e980d68b77e572d80fe7
new file mode 100644
index 0000000..0733fa2
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/ca/7d316d6d9af99d2481e980d68b77e572d80fe7 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/ca/fa936d25f0b397432a27201f6b3284c47df8be b/tests/resources/merge-recursive/.gitted/objects/ca/fa936d25f0b397432a27201f6b3284c47df8be
new file mode 100644
index 0000000..fb012ee
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/ca/fa936d25f0b397432a27201f6b3284c47df8be differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/cb/49ad76147f5f9439cbd6133708b76142660660 b/tests/resources/merge-recursive/.gitted/objects/cb/49ad76147f5f9439cbd6133708b76142660660
new file mode 100644
index 0000000..849668c
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/cb/49ad76147f5f9439cbd6133708b76142660660 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/d0/dd5d9083bda65ec99aa8b9b64a5a278771b70a b/tests/resources/merge-recursive/.gitted/objects/d0/dd5d9083bda65ec99aa8b9b64a5a278771b70a
new file mode 100644
index 0000000..b0d951c
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/d0/dd5d9083bda65ec99aa8b9b64a5a278771b70a differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/d2/682aaf9594080ce877b5eeee110850fd6e3480 b/tests/resources/merge-recursive/.gitted/objects/d2/682aaf9594080ce877b5eeee110850fd6e3480
new file mode 100644
index 0000000..c79a3bb
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/d2/682aaf9594080ce877b5eeee110850fd6e3480
@@ -0,0 +1 @@
+x%Pn@|_IPS)SХ$2ʶp>'9F:gH$it]p:?p``dΝBzBE)aۅt@4+FC{b]&
yl`(p9[*mx`?t2.Ԩ^ReMEZVEƕd;z@>+r^[<aż~9ր0uhE`$$S:a2%Sw^bJ>fFOvۅЋ
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/d6/04c75019c282144bdbbf3fd3462ba74b240efc b/tests/resources/merge-recursive/.gitted/objects/d6/04c75019c282144bdbbf3fd3462ba74b240efc
new file mode 100644
index 0000000..059fcfe
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/d6/04c75019c282144bdbbf3fd3462ba74b240efc differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03 b/tests/resources/merge-recursive/.gitted/objects/d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03
new file mode 100644
index 0000000..6672008
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/d8/dd349b78f19a4ebe3357bacb8138f00bf5ed41 b/tests/resources/merge-recursive/.gitted/objects/d8/dd349b78f19a4ebe3357bacb8138f00bf5ed41
new file mode 100644
index 0000000..ade33f7
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/d8/dd349b78f19a4ebe3357bacb8138f00bf5ed41 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/d8/e05a90b3c2240d71a20c2502c937d9b7d22777 b/tests/resources/merge-recursive/.gitted/objects/d8/e05a90b3c2240d71a20c2502c937d9b7d22777
new file mode 100644
index 0000000..b157ba1
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/d8/e05a90b3c2240d71a20c2502c937d9b7d22777
@@ -0,0 +1,2 @@
+x%Pn@|_IQS)SХ$2ʶp>'9F:gH$it]p:oB8u0L2N!=ZĔ0B: !ѽ1.s	Ӽ60FvZMA^
+Vn-yb6<0ׇq-jT/)ɲʦ"-[UOgz@>+r^[<aż~9ր0uhE`$$S:a2%Sw^bJ>fFOvۄ𶋅
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/da/b7b53383a1fec46632e60a1d847ce4f9ae14f2 b/tests/resources/merge-recursive/.gitted/objects/da/b7b53383a1fec46632e60a1d847ce4f9ae14f2
new file mode 100644
index 0000000..cc4f243
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/da/b7b53383a1fec46632e60a1d847ce4f9ae14f2 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/db/203155a789fb749aa3c14e93eea2c744a9c6c7 b/tests/resources/merge-recursive/.gitted/objects/db/203155a789fb749aa3c14e93eea2c744a9c6c7
new file mode 100644
index 0000000..e9f7fd8
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/db/203155a789fb749aa3c14e93eea2c744a9c6c7
@@ -0,0 +1 @@
+xMJ1]$_q;/t;DԦ((K	k2SA,J*b[,'KG
dyRP0PuF1 o$jL81}l}6'q/}9nC#$mQ'=-DŽzN<h{XkE\cZ
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/de/a7215f259b2cced87d1bda6c72f8b4ce37a2ff b/tests/resources/merge-recursive/.gitted/objects/de/a7215f259b2cced87d1bda6c72f8b4ce37a2ff
new file mode 100644
index 0000000..55c1983
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/de/a7215f259b2cced87d1bda6c72f8b4ce37a2ff differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/e1/512550f09d980214e46e6d3f5a2b20c3d75755 b/tests/resources/merge-recursive/.gitted/objects/e1/512550f09d980214e46e6d3f5a2b20c3d75755
new file mode 100644
index 0000000..a5f506f
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/e1/512550f09d980214e46e6d3f5a2b20c3d75755 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/e1/dcfc3038be54195a59817c89782b261e46cb05 b/tests/resources/merge-recursive/.gitted/objects/e1/dcfc3038be54195a59817c89782b261e46cb05
new file mode 100644
index 0000000..3668b54
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/e1/dcfc3038be54195a59817c89782b261e46cb05
@@ -0,0 +1 @@
+xN1:O:%/uݠ\OGTG5ܶ2yw7x-X1pM`#ؠ6%F]œᤙ"HyI)8Կy*X_CX\1VB9JAX[Aڶk$Rg>ܶ{nD2ZQk5Yn0hn,UV8e
N;G>>MpM
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/e2/93bfdddb81a853bbb16b8b58e68626f30841a4 b/tests/resources/merge-recursive/.gitted/objects/e2/93bfdddb81a853bbb16b8b58e68626f30841a4
new file mode 100644
index 0000000..fab55fe
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/e2/93bfdddb81a853bbb16b8b58e68626f30841a4 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/e2/c84bb33992a455b1a7a5019f0e38d883d3f475 b/tests/resources/merge-recursive/.gitted/objects/e2/c84bb33992a455b1a7a5019f0e38d883d3f475
new file mode 100644
index 0000000..8c66867
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/e2/c84bb33992a455b1a7a5019f0e38d883d3f475 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/e2/d185fa827d58134cea20b9e1df893833c6560e b/tests/resources/merge-recursive/.gitted/objects/e2/d185fa827d58134cea20b9e1df893833c6560e
new file mode 100644
index 0000000..fc80c08
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/e2/d185fa827d58134cea20b9e1df893833c6560e differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/e5/0fbbd701458757bdfe9815f58ed717c588d1b5 b/tests/resources/merge-recursive/.gitted/objects/e5/0fbbd701458757bdfe9815f58ed717c588d1b5
new file mode 100644
index 0000000..96467c1
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/e5/0fbbd701458757bdfe9815f58ed717c588d1b5
@@ -0,0 +1,3 @@
+x%P1n0Wݡ@SKCCG%QXr}&IKi*ݡRKl8͆Uj2*HLx>3?03RKXNXPZɩ9[-=\߷_밓q9El-ҳ*X7n\$
+C: hVe^[<ᨐżԄE
+7LH[@Wvfw.0u:Ժ.U=Ld{L	40m$ox
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/ef/1783444b61a8671beea4ce1f4d0202677dfbfb b/tests/resources/merge-recursive/.gitted/objects/ef/1783444b61a8671beea4ce1f4d0202677dfbfb
new file mode 100644
index 0000000..67e6e8a
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/ef/1783444b61a8671beea4ce1f4d0202677dfbfb
@@ -0,0 +1,3 @@
+xO[
+0;TI "l-Fj3Pr+(+7ue~0bxL4A;TpJDŽcZqd#FmDkdGg
+5e*Qqs?৶=1Vmc+Y#eI9yv5	70U
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/f1/3e1bc6ba935fce2efffa5be4c4832404034ef1 b/tests/resources/merge-recursive/.gitted/objects/f1/3e1bc6ba935fce2efffa5be4c4832404034ef1
new file mode 100644
index 0000000..e115747
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/f1/3e1bc6ba935fce2efffa5be4c4832404034ef1 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/f1/72517a8cf39e009ffff541ee52429b89e418f3 b/tests/resources/merge-recursive/.gitted/objects/f1/72517a8cf39e009ffff541ee52429b89e418f3
new file mode 100644
index 0000000..3d29a0f
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/f1/72517a8cf39e009ffff541ee52429b89e418f3 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/f1/b44c04989a3a1c14b036cfadfa328d53a7bc5e b/tests/resources/merge-recursive/.gitted/objects/f1/b44c04989a3a1c14b036cfadfa328d53a7bc5e
new file mode 100644
index 0000000..7cbaaee
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/f1/b44c04989a3a1c14b036cfadfa328d53a7bc5e differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/f3/5f159ff5d44dfd9f52d63dd5b659f0521ff569 b/tests/resources/merge-recursive/.gitted/objects/f3/5f159ff5d44dfd9f52d63dd5b659f0521ff569
new file mode 100644
index 0000000..5179f2c
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/f3/5f159ff5d44dfd9f52d63dd5b659f0521ff569 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/f5/1658077d85f2264fa179b4d0848268cb3475c3 b/tests/resources/merge-recursive/.gitted/objects/f5/1658077d85f2264fa179b4d0848268cb3475c3
new file mode 100644
index 0000000..3b4eb97
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/objects/f5/1658077d85f2264fa179b4d0848268cb3475c3
@@ -0,0 +1,2 @@
+xERN1W,}D@Jsl^'3Ǯz}{@٘o^X3y';K8ęOlI)g7d3QFABFtc9*~)@a1L.ݜĔXiV1a2tP*$%ɝ׭q$ET<<UP;uKu*T⤛
+&U-q̱*nѥ
fgg:ע4!AASmĹiQށm
E43FgFғaD5 Y)G8@*g1NN;_jw3*Fzv~y|s
\ No newline at end of file
diff --git a/tests/resources/merge-recursive/.gitted/objects/f7/929c5a67a4bdc98247fb4b5098675723932a64 b/tests/resources/merge-recursive/.gitted/objects/f7/929c5a67a4bdc98247fb4b5098675723932a64
new file mode 100644
index 0000000..2861579
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/f7/929c5a67a4bdc98247fb4b5098675723932a64 differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/fa/567f568ed72157c0c617438d077695b99d9aac b/tests/resources/merge-recursive/.gitted/objects/fa/567f568ed72157c0c617438d077695b99d9aac
new file mode 100644
index 0000000..ad5a3cf
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/fa/567f568ed72157c0c617438d077695b99d9aac differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/fd/8b5fe88cda995e70a22ed98701e65b843e05ec b/tests/resources/merge-recursive/.gitted/objects/fd/8b5fe88cda995e70a22ed98701e65b843e05ec
new file mode 100644
index 0000000..b6f1463
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/fd/8b5fe88cda995e70a22ed98701e65b843e05ec differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/fe/f01f3104c8047d05e8572e521c454f8fd4b8db b/tests/resources/merge-recursive/.gitted/objects/fe/f01f3104c8047d05e8572e521c454f8fd4b8db
new file mode 100644
index 0000000..715b6a8
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/fe/f01f3104c8047d05e8572e521c454f8fd4b8db differ
diff --git a/tests/resources/merge-recursive/.gitted/objects/ff/b36e513f5fdf8a6ba850a20142676a2ac4807d b/tests/resources/merge-recursive/.gitted/objects/ff/b36e513f5fdf8a6ba850a20142676a2ac4807d
new file mode 100644
index 0000000..f655d12
Binary files /dev/null and b/tests/resources/merge-recursive/.gitted/objects/ff/b36e513f5fdf8a6ba850a20142676a2ac4807d differ
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchA-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchA-1
new file mode 100644
index 0000000..b55325c
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchA-1
@@ -0,0 +1 @@
+539bd011c4822c560c1d17cab095006b7a10f707
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchA-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchA-2
new file mode 100644
index 0000000..d355743
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchA-2
@@ -0,0 +1 @@
+0bb7ed583d7e9ad507e8b902594f5c9126ea456b
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchB-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchB-1
new file mode 100644
index 0000000..d2eecb7
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchB-1
@@ -0,0 +1 @@
+a34e5a16feabbd0335a633aadb8217c9f3dba58d
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchB-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchB-2
new file mode 100644
index 0000000..d5cfb27
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchB-2
@@ -0,0 +1 @@
+723181f1bfd30e47a6d1d36a4d874e31e7a0a1a4
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchC-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchC-1
new file mode 100644
index 0000000..346b039
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchC-1
@@ -0,0 +1 @@
+ad2ace9e15f66b3d1138922e6ffdc3ea3f967fa6
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchC-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchC-2
new file mode 100644
index 0000000..67f3153
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchC-2
@@ -0,0 +1 @@
+815b5a1c80ca749d705c7aa0cb294a00cbedd340
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchD-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchD-1
new file mode 100644
index 0000000..fa96ccb
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchD-1
@@ -0,0 +1 @@
+4dfc1be85a9d6c9898152444d32b238b4aecf8cc
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchD-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchD-2
new file mode 100644
index 0000000..8a87f98
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchD-2
@@ -0,0 +1 @@
+007f1ee2af8e5d99906867c4237510e1790a89b8
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchE-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchE-1
new file mode 100644
index 0000000..b8d011e
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchE-1
@@ -0,0 +1 @@
+ca224bba0a8a24f1768804fe5f565b1014af7ef2
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchE-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchE-2
new file mode 100644
index 0000000..5e1e1ac
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchE-2
@@ -0,0 +1 @@
+436ea75c99f527e4b42fddb46abedf7726eb719d
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchE-3 b/tests/resources/merge-recursive/.gitted/refs/heads/branchE-3
new file mode 100644
index 0000000..eaec8d8
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchE-3
@@ -0,0 +1 @@
+9b258ad4c39f40c24f66bf1faf48eb6202d59c85
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchF-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchF-1
new file mode 100644
index 0000000..5f2ca91
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchF-1
@@ -0,0 +1 @@
+783d6539dde96b8873c5b5da3e79cc14cd64830b
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchF-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchF-2
new file mode 100644
index 0000000..abe2ea9
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchF-2
@@ -0,0 +1 @@
+ef1783444b61a8671beea4ce1f4d0202677dfbfb
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchG-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchG-1
new file mode 100644
index 0000000..af51143
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchG-1
@@ -0,0 +1 @@
+c483ca4bb087174af5cb51d7caa9c09fe4a28ccb
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchG-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchG-2
new file mode 100644
index 0000000..24177a2
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchG-2
@@ -0,0 +1 @@
+d71c24b3b113fd1d1909998c5bfe33b86a65ee03
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchH-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchH-1
new file mode 100644
index 0000000..ffe9f8c
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchH-1
@@ -0,0 +1 @@
+7a9277e0c5ec75339f011c176d0c20e513c4de1c
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchH-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchH-2
new file mode 100644
index 0000000..84ed1a2
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchH-2
@@ -0,0 +1 @@
+db203155a789fb749aa3c14e93eea2c744a9c6c7
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchI-1 b/tests/resources/merge-recursive/.gitted/refs/heads/branchI-1
new file mode 100644
index 0000000..2d1ecd0
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchI-1
@@ -0,0 +1 @@
+5607a8c4601a737daadd1f470bde3142aff57026
diff --git a/tests/resources/merge-recursive/.gitted/refs/heads/branchI-2 b/tests/resources/merge-recursive/.gitted/refs/heads/branchI-2
new file mode 100644
index 0000000..fc360ba
--- /dev/null
+++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchI-2
@@ -0,0 +1 @@
+f7929c5a67a4bdc98247fb4b5098675723932a64
diff --git a/tests/resources/merge-recursive/asparagus.txt b/tests/resources/merge-recursive/asparagus.txt
new file mode 100644
index 0000000..ffb36e5
--- /dev/null
+++ b/tests/resources/merge-recursive/asparagus.txt
@@ -0,0 +1,10 @@
+ASPARAGUS SOUP.
+
+Take four large bunches of asparagus, scrape it nicely, cut off one inch
+of the tops, and lay them in water, chop the stalks and put them on the
+fire with a piece of bacon, a large onion cut up, and pepper and salt;
+add two quarts of water, boil them till the stalks are quite soft, then
+pulp them through a sieve, and strain the water to it, which must be put
+back in the pot; put into it a chicken cut up, with the tops of
+asparagus which had been laid by, boil it until these last articles are
+sufficiently done, thicken with flour, butter and milk, and serve it up.
diff --git a/tests/resources/merge-recursive/beef.txt b/tests/resources/merge-recursive/beef.txt
new file mode 100644
index 0000000..68f6182
--- /dev/null
+++ b/tests/resources/merge-recursive/beef.txt
@@ -0,0 +1,22 @@
+BEEF SOUP.
+
+Take the hind shin of beef, cut off all the flesh off the leg-bone,
+which must be taken away entirely, or the soup will be greasy. Wash the
+meat clean and lay it in a pot, sprinkle over it one small
+table-spoonful of pounded black pepper, and two of salt; three onions
+the size of a hen's egg, cut small, six small carrots scraped and cut
+up, two small turnips pared and cut into dice; pour on three quarts of
+water, cover the pot close, and keep it gently and steadily boiling five
+hours, which will leave about three pints of clear soup; do not let the
+pot boil over, but take off the scum carefully, as it rises. When it has
+boiled four hours, put in a small bundle of thyme and parsley, and a
+pint of celery cut small, or a tea-spoonful of celery seed pounded.
+These latter ingredients would lose their delicate flavour if boiled too
+much. Just before you take it up, brown it in the following manner: put
+a small table-spoonful of nice brown sugar into an iron skillet, set it
+on the fire and stir it till it melts and looks very dark, pour into it
+a ladle full of the soup, a little at a time; stirring it all the while.
+Strain this browning and mix it well with the soup; take out the bundle
+of thyme and parsley, put the nicest pieces of meat in your tureen, and
+pour on the soup and vegetables; put in some toasted bread cut in dice,
+and serve it up.
diff --git a/tests/resources/merge-recursive/bouilli.txt b/tests/resources/merge-recursive/bouilli.txt
new file mode 100644
index 0000000..4b7c565
--- /dev/null
+++ b/tests/resources/merge-recursive/bouilli.txt
@@ -0,0 +1,18 @@
+SOUP WITH BOUILLI.
+
+Take the nicest part of the thick brisket of beef, about eight pounds,
+put it into a pot with every thing directed for the other soup; make it
+exactly in the same way, only put it on an hour sooner, that you may
+have time to prepare the bouilli; after it has boiled five hours, take
+out the beef, cover up the soup and set it near the fire that it may
+keep hot. Take the skin off the beef, have the yelk of an egg well
+beaten, dip a feather in it and wash the top of your beef, sprinkle over
+it the crumb of stale bread finely grated, put it in a Dutch oven
+previously heated, put the top on with coals enough to brown, but not
+burn the beef; let it stand nearly an hour, and prepare your gravy
+thus:--Take a sufficient quantity of soup and the vegetables boiled in
+it; add to it a table-spoonful of red wine, and two of mushroom catsup,
+thicken with a little bit of butter and a little brown flour; make it
+very hot, pour it in your dish, and put the beef on it. Garnish it with
+green pickle, cut in thin slices, serve up the soup in a tureen with
+bits of toasted bread.
diff --git a/tests/resources/merge-recursive/gravy.txt b/tests/resources/merge-recursive/gravy.txt
new file mode 100644
index 0000000..c4e6cca
--- /dev/null
+++ b/tests/resources/merge-recursive/gravy.txt
@@ -0,0 +1,8 @@
+GRAVY SOUP.
+
+Get eight pounds of coarse lean beef--wash it clean and lay it in your
+pot, put in the same ingredients as for the shin soup, with the same
+quantity of water, and follow the process directed for that. Strain the
+soup through a sieve, and serve it up clear, with nothing more than
+toasted bread in it; two table-spoonsful of mushroom catsup will add a
+fine flavour to the soup.
diff --git a/tests/resources/merge-recursive/oyster.txt b/tests/resources/merge-recursive/oyster.txt
new file mode 100644
index 0000000..7c7e08f
--- /dev/null
+++ b/tests/resources/merge-recursive/oyster.txt
@@ -0,0 +1,13 @@
+OYSTER SOUP!
+
+Wash and drain two quarts of oysters, put them on with three quarts of
+water, three onions chopped up, two or three slices of lean ham, pepper
+and salt; boil it till reduced one-half, strain it through a sieve,
+return the liquid into the pot, put in one quart of fresh oysters, boil
+it till they are sufficiently done, and thicken the soup with four
+spoonsful of flour, two gills of rich cream, and the yelks of six new
+laid eggs beaten well; boil it a few minutes after the thickening is put
+in. Take care that it does not curdle, and that the flour is not in
+lumps; serve it up with the last oysters that were put in. If the
+flavour of thyme be agreeable, you may put in a little, but take care
+that it does not boil in it long enough to discolour the soup.
diff --git a/tests/resources/merge-recursive/veal.txt b/tests/resources/merge-recursive/veal.txt
new file mode 100644
index 0000000..898d126
--- /dev/null
+++ b/tests/resources/merge-recursive/veal.txt
@@ -0,0 +1,20 @@
+VEAL SOUP.
+
+PUT INTO A POT THREE QUARTS OF WATER, 3 onions cut small, ONE
+spoonful of black pepper pounded, and two of salt, with two or three
+slices of lean ham; let it boil steadily two hours; skim it
+occasionally, then put into it a shin of veal, let it boil two hours
+longer; take out the slices of ham, and skim off the grease if any
+should rise, take a gill of good cream, mix with it two table-spoonsful
+of flour very nicely, and the yelks of two eggs beaten well, strain this
+mixture, and add some chopped parsley; pour some soup on by degrees,
+stir it well, and pour it into the pot, continuing to stir until it has
+boiled two or three minutes to take off the raw taste of the eggs. If
+the cream be not perfectly sweet, and the eggs quite new, the thickening
+will curdle in the soup. For a change you may put a dozen ripe tomatos
+in, first taking off their skins, by letting them stand a few minutes in
+hot water, when they may be easily peeled. When made in this way you
+must thicken it with the flour only. Any part of the veal may be used,
+but the shin or knuckle is the nicest.
+
+This is a mighty fine recipe!
diff --git a/tests/revert/workdir.c b/tests/revert/workdir.c
index 9f83bd8..802819c 100644
--- a/tests/revert/workdir.c
+++ b/tests/revert/workdir.c
@@ -410,7 +410,7 @@ void test_revert_workdir__rename_1_of_2(void)
 		{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 2, "file6.txt" },
 	};
 
-	opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
 	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "cef56612d71a6af8d8015691e4865f7fece905b5");
@@ -444,7 +444,7 @@ void test_revert_workdir__rename(void)
 		{ "file4.txt", "file5.txt", "" },
 	};
 
-	opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
 	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "55568c8de5322ff9a95d72747a239cdb64a19965");