mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 15:10:02 +00:00
Tests: Add test for check out of given branch during clone
This commit is contained in:
parent
b5b2812097
commit
f1d4a35e94
@ -164,3 +164,14 @@ void test_clone_nonetwork__can_prevent_the_checkout_of_a_standard_repo(void)
|
|||||||
git_buf_free(&path);
|
git_buf_free(&path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_clone_nonetwork__can_checkout_given_branch(void)
|
||||||
|
{
|
||||||
|
g_options.checkout_branch = "test";
|
||||||
|
cl_git_pass(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", &g_options));
|
||||||
|
|
||||||
|
cl_assert_equal_i(0, git_repository_head_orphan(g_repo));
|
||||||
|
|
||||||
|
cl_git_pass(git_repository_head(&g_ref, g_repo));
|
||||||
|
cl_assert_equal_s(git_reference_name(g_ref), "refs/heads/test");
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user