diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-10-27 00:14:28 +0300 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-11-25 23:37:22 +0300 |
commit | cdb6c1c83dd6f0d30b798a7f62d4f3849a1f11a1 (patch) | |
tree | d0efebcea95b4fd53541f57f2ae6f73151ebd48e | |
parent | 75dee59c94d39b308529d45dfb993b25d2e9a5f0 (diff) |
merge: add a second-level recursive merge
12 files changed, 57 insertions, 2 deletions
diff --git a/tests/merge/trees/recursive.c b/tests/merge/trees/recursive.c index 1d3586162..a7358e7e3 100644 --- a/tests/merge/trees/recursive.c +++ b/tests/merge/trees/recursive.c @@ -88,8 +88,6 @@ void test_merge_trees_recursive__two_norecursive(void) git_index *index; git_merge_options opts = GIT_MERGE_OPTIONS_INIT; - opts.flags |= GIT_MERGE_NO_RECURSIVE; - struct merge_index_entry merge_index_entries[] = { { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, @@ -101,6 +99,8 @@ void test_merge_trees_recursive__two_norecursive(void) { 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)); @@ -108,3 +108,49 @@ void test_merge_trees_recursive__two_norecursive(void) git_index_free(index); } +void test_merge_trees_recursive__three(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__three_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); +} + 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 000000000..b06362dd8 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/0f/a6ead2731b9d138afe38c336c9727ea05027a7 @@ -0,0 +1 @@ +xJAE+*hk"bhTw8̴-\0/2<nKI\9D`5Tdϩ4JmI)ꈼ"-鄱晴O'3YG JAXSd#(NPxzmpg{q>e9ѱsӞ3=Y1pFe2oz
\ No newline at end of file diff --git a/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78 b/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78 Binary files differnew file mode 100644 index 000000000..5dc102d35 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78 diff --git a/tests/resources/merge-recursive/.gitted/objects/4e/70a6b06fc62481f80fbb74327849e7170eebff b/tests/resources/merge-recursive/.gitted/objects/4e/70a6b06fc62481f80fbb74327849e7170eebff Binary files differnew file mode 100644 index 000000000..1dfcec50b --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/4e/70a6b06fc62481f80fbb74327849e7170eebff diff --git a/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370 b/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370 Binary files differnew file mode 100644 index 000000000..6d7c948c9 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370 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 000000000..1495f70f4 --- /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/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 b/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 new file mode 100644 index 000000000..12eb0662a --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 @@ -0,0 +1,5 @@ +xK +1D]}|:
@`Hx}G^ARw32t99^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/89/8d12687fb35be271c27c795a6b32c8b51da79e b/tests/resources/merge-recursive/.gitted/objects/89/8d12687fb35be271c27c795a6b32c8b51da79e Binary files differnew file mode 100644 index 000000000..2ce4f7f0a --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/89/8d12687fb35be271c27c795a6b32c8b51da79e diff --git a/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 b/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 Binary files differnew file mode 100644 index 000000000..8ae3ba5a7 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 diff --git a/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e b/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e Binary files differnew file mode 100644 index 000000000..3dde6c243 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e 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 000000000..346b039b4 --- /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 000000000..67f3153f5 --- /dev/null +++ b/tests/resources/merge-recursive/.gitted/refs/heads/branchC-2 @@ -0,0 +1 @@ +815b5a1c80ca749d705c7aa0cb294a00cbedd340 |