mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-18 18:30:29 +00:00
parent
09e29e47b3
commit
2a3b3e0324
@ -1173,7 +1173,14 @@ static int checkout_data_init(
|
||||
|
||||
if (!data->opts.baseline) {
|
||||
data->opts_free_baseline = true;
|
||||
if ((error = checkout_lookup_head_tree(&data->opts.baseline, repo)) < 0)
|
||||
error = checkout_lookup_head_tree(&data->opts.baseline, repo);
|
||||
|
||||
if (error == GIT_EORPHANEDHEAD) {
|
||||
error = 0;
|
||||
giterr_clear();
|
||||
}
|
||||
|
||||
if (error < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -498,3 +498,13 @@ void test_checkout_index__can_update_prefixed_files(void)
|
||||
cl_assert(!git_path_exists("testrepo/branch_file"));
|
||||
cl_assert(!git_path_exists("testrepo/branch_file.txt.after"));
|
||||
}
|
||||
|
||||
void test_checkout_index__can_checkout_a_newly_initialized_repository(void)
|
||||
{
|
||||
test_checkout_index__cleanup();
|
||||
|
||||
g_repo = cl_git_sandbox_init("empty_standard_repo");
|
||||
cl_git_remove_placeholders(git_repository_path(g_repo), "dummy-marker.txt");
|
||||
|
||||
cl_git_pass(git_checkout_index(g_repo, NULL, NULL));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user