mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-05 14:37:37 +00:00
merge: add a third-level recursive merge
This commit is contained in:
parent
cdb6c1c83d
commit
a200bcf728
@ -154,3 +154,49 @@ void test_merge_trees_recursive__three_norecursive(void)
|
||||
git_index_free(index);
|
||||
}
|
||||
|
||||
void test_merge_trees_recursive__four(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__four_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);
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
tests/resources/merge-recursive/.gitted/refs/heads/branchD-1
Normal file
BIN
tests/resources/merge-recursive/.gitted/refs/heads/branchD-1
Normal file
Binary file not shown.
BIN
tests/resources/merge-recursive/.gitted/refs/heads/branchD-2
Normal file
BIN
tests/resources/merge-recursive/.gitted/refs/heads/branchD-2
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user