diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-10-27 22:23:35 +0300 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-11-25 23:37:39 +0300 |
commit | fccad82ee8f431e06097b3a1282228b40ae7128f (patch) | |
tree | b9a76183b429afa1f12b4a1c06cda047800a764c | |
parent | 99d9d9a470ca9b693f6dbee05f1cfcd98a5d148d (diff) |
merge: add recursive test with three merge bases
28 files changed, 65 insertions, 0 deletions
diff --git a/tests/merge/trees/recursive.c b/tests/merge/trees/recursive.c index bff5d7e39..46effa5c2 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 000000000..85887e0f5 --- /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+300/`#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 Binary files differnew file mode 100644 index 000000000..c99a6865c --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/0e/8126647ec607f0a14122cec4b15315d790c8ff diff --git a/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175 b/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175 Binary files differnew file mode 100644 index 000000000..a2146496d --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175 diff --git a/tests/resources/merge-recursive/.gitted/objects/1e/8dff96faaaa24f84943d2d9601dde61cb0398a b/tests/resources/merge-recursive/.gitted/objects/1e/8dff96faaaa24f84943d2d9601dde61cb0398a Binary files differnew file mode 100644 index 000000000..b6185f294 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/1e/8dff96faaaa24f84943d2d9601dde61cb0398a 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 000000000..e8825d867 --- /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 Binary files differnew file mode 100644 index 000000000..85bc8f569 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/5a/ba269b3be41fc8db38068d3948c8af543fe609 diff --git a/tests/resources/merge-recursive/.gitted/objects/73/b20c8e09fa2726d69ff66969186014165da3c3 b/tests/resources/merge-recursive/.gitted/objects/73/b20c8e09fa2726d69ff66969186014165da3c3 Binary files differnew file mode 100644 index 000000000..6559958c5 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/73/b20c8e09fa2726d69ff66969186014165da3c3 diff --git a/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 b/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 Binary files differnew file mode 100644 index 000000000..c4b835518 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 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 000000000..a03624d81 --- /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%[R
\ 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 000000000..70bf8fbb0 --- /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| tTr˸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 Binary files differnew file mode 100644 index 000000000..0cbd00d53 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/9a/e63b4a8ce0f181b2d1d098971733a103226917 diff --git a/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 b/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 Binary files differnew file mode 100644 index 000000000..305e1f3e9 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 diff --git a/tests/resources/merge-recursive/.gitted/objects/9e/12bce04446d097ae1782967a5888c2e2a0d35b b/tests/resources/merge-recursive/.gitted/objects/9e/12bce04446d097ae1782967a5888c2e2a0d35b Binary files differnew file mode 100644 index 000000000..0940d09c2 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/9e/12bce04446d097ae1782967a5888c2e2a0d35b 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 000000000..91ffb4b88 --- /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 Binary files differnew file mode 100644 index 000000000..457f9da1f --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/ad/98bfa4679fb00b89207a0a11b8bbf91a3e4de9 diff --git a/tests/resources/merge-recursive/.gitted/objects/bd/97980c22d122509cdd915fd9788d56c8d3ae20 b/tests/resources/merge-recursive/.gitted/objects/bd/97980c22d122509cdd915fd9788d56c8d3ae20 Binary files differnew file mode 100644 index 000000000..71295e071 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/bd/97980c22d122509cdd915fd9788d56c8d3ae20 diff --git a/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2 b/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2 Binary files differnew file mode 100644 index 000000000..0dd861f2c --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2 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 000000000..c79a3bb0f --- /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 Binary files differnew file mode 100644 index 000000000..ade33f7f5 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/d8/dd349b78f19a4ebe3357bacb8138f00bf5ed41 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 000000000..b157ba17c --- /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 Binary files differnew file mode 100644 index 000000000..cc4f24369 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/da/b7b53383a1fec46632e60a1d847ce4f9ae14f2 diff --git a/tests/resources/merge-recursive/.gitted/objects/e2/d185fa827d58134cea20b9e1df893833c6560e b/tests/resources/merge-recursive/.gitted/objects/e2/d185fa827d58134cea20b9e1df893833c6560e Binary files differnew file mode 100644 index 000000000..fc80c0851 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/e2/d185fa827d58134cea20b9e1df893833c6560e 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 000000000..96467c106 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/e5/0fbbd701458757bdfe9815f58ed717c588d1b5 @@ -0,0 +1,3 @@ +x%P1n0Wݡ@SKCCG%QXr}&IKi*ݡRKl8͆Uj2*HLx>3?03RKXNXPZɩ9[-=\߷_밓q9El-ҳ*X7n\$ +C: hVe^[<ᨐżԄE +7LH[@Wvfw.0u:Ժ.U=Ld{L 40m$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 Binary files differnew file mode 100644 index 000000000..3d29a0fe8 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/f1/72517a8cf39e009ffff541ee52429b89e418f3 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 000000000..b8d011e2d --- /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 000000000..5e1e1acd9 --- /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 000000000..eaec8d81a --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchE-3 @@ -0,0 +1 @@ +9b258ad4c39f40c24f66bf1faf48eb6202d59c85 |