mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-12 11:17:37 +00:00
merge_trees: introduce test for submodule renames
Test that shows that submodules are incorrectly considered in renames, and `git_merge_trees` will fail to lookup the submodule as a blob.
This commit is contained in:
parent
b4bd5e8453
commit
49806e9bc4
@ -252,3 +252,25 @@ void test_merge_trees_renames__no_rename_index(void)
|
||||
|
||||
git_index_free(index);
|
||||
}
|
||||
|
||||
void test_merge_trees_renames__submodules(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_options *opts = NULL;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "cd3e8d4aa06bdc781f264171030bc28f2b370fee", 0, ".gitmodules" },
|
||||
{ 0100644, "4dd1ef7569b18d92d93c0a35bb6b93049137b355", 1, "file.txt" },
|
||||
{ 0100644, "a2d8d1824c68541cca94ffb90f79291eba495921", 2, "file.txt" },
|
||||
{ 0100644, "63ec604d491161ddafdae4179843c26d54bd999a", 3, "file.txt" },
|
||||
{ 0160000, "0000000000000000000000000000000000000001", 1, "submodule1" },
|
||||
{ 0160000, "0000000000000000000000000000000000000002", 3, "submodule1" },
|
||||
{ 0160000, "0000000000000000000000000000000000000003", 0, "submodule2" },
|
||||
};
|
||||
|
||||
cl_git_pass(merge_trees_from_branches(&index, repo,
|
||||
"submodule_rename1", "submodule_rename2",
|
||||
opts));
|
||||
cl_assert(merge_test_index(index, merge_index_entries, 7));
|
||||
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user