Commit fccad82ee8f431e06097b3a1282228b40ae7128f

Edward Thomson 2015-10-27T14:23:35

merge: add recursive test with three merge bases

diff --git a/tests/merge/trees/recursive.c b/tests/merge/trees/recursive.c
index bff5d7e..46effa5 100644
--- a/tests/merge/trees/recursive.c
+++ b/tests/merge/trees/recursive.c
@@ -200,3 +200,49 @@ void test_merge_trees_recursive__three_levels_of_multiple_bases_norecursive(void
 	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);
+}
+
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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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