mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-13 19:30:37 +00:00
Add test case
This commit is contained in:
parent
1d0bed9de1
commit
85196232e8
BIN
tests/resources/redundant.git/HEAD
Normal file
BIN
tests/resources/redundant.git/HEAD
Normal file
Binary file not shown.
BIN
tests/resources/redundant.git/config
Executable file
BIN
tests/resources/redundant.git/config
Executable file
Binary file not shown.
BIN
tests/resources/redundant.git/objects/info/packs
Normal file
BIN
tests/resources/redundant.git/objects/info/packs
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
tests/resources/redundant.git/packed-refs
Normal file
BIN
tests/resources/redundant.git/packed-refs
Normal file
Binary file not shown.
0
tests/resources/redundant.git/refs/.gitkeep
Normal file
0
tests/resources/redundant.git/refs/.gitkeep
Normal file
@ -492,3 +492,22 @@ void test_revwalk_mergebase__octopus_merge_branch(void)
|
||||
*
|
||||
* a
|
||||
*/
|
||||
|
||||
void test_revwalk_mergebase__remove_redundant(void)
|
||||
{
|
||||
git_repository *repo;
|
||||
git_oid one, two, base;
|
||||
git_oidarray result = {NULL, 0};
|
||||
|
||||
cl_git_pass(git_repository_open(&repo, cl_fixture("redundant.git")));
|
||||
|
||||
cl_git_pass(git_oid_fromstr(&one, "d89137c93ba1ee749214ff4ce52ae9137bc833f9"));
|
||||
cl_git_pass(git_oid_fromstr(&two, "91f4b95df4a59504a9813ba66912562931d990e3"));
|
||||
cl_git_pass(git_oid_fromstr(&base, "6cb1f2352d974e1c5a776093017e8772416ac97a"));
|
||||
|
||||
cl_git_pass(git_merge_bases(&result, repo, &one, &two));
|
||||
cl_assert_equal_i(1, result.count);
|
||||
cl_assert_equal_oid(&base, &result.ids[0]);
|
||||
|
||||
git_repository_free(repo);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user