@@ -425,8 +425,7 @@ void test_repo_init__extended_1(void)
425
425
struct stat st ;
426
426
git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT ;
427
427
428
- opts .flags = GIT_REPOSITORY_INIT_MKPATH |
429
- GIT_REPOSITORY_INIT_NO_DOTGIT_DIR ;
428
+ opts .flags = GIT_REPOSITORY_INIT_MKPATH ;
430
429
opts .mode = GIT_REPOSITORY_INIT_SHARED_GROUP ;
431
430
opts .workdir_path = "../c_wd" ;
432
431
opts .description = "Awesomest test repository evah" ;
@@ -466,16 +465,18 @@ void test_repo_init__extended_1(void)
466
465
void test_repo_init__relative_gitdir (void )
467
466
{
468
467
git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT ;
468
+ git_str head_content = GIT_STR_INIT ;
469
469
git_str dot_git_content = GIT_STR_INIT ;
470
470
471
471
opts .workdir_path = "../c_wd" ;
472
472
opts .flags =
473
473
GIT_REPOSITORY_INIT_MKPATH |
474
- GIT_REPOSITORY_INIT_RELATIVE_GITLINK |
475
- GIT_REPOSITORY_INIT_NO_DOTGIT_DIR ;
474
+ GIT_REPOSITORY_INIT_RELATIVE_GITLINK ;
476
475
477
476
/* make the directory first, then it should succeed */
478
477
cl_git_pass (git_repository_init_ext (& g_repo , "root/b/my_repository" , & opts ));
478
+ cl_git_pass (git_futils_readbuffer (& head_content , "root/b/my_repository/HEAD" ));
479
+ cl_assert_equal_s ("ref: refs/heads/master\n" , head_content .ptr );
479
480
480
481
cl_assert (!git__suffixcmp (git_repository_workdir (g_repo ), "root/b/c_wd/" ));
481
482
cl_assert (!git__suffixcmp (git_repository_path (g_repo ), "root/b/my_repository/" ));
@@ -491,6 +492,7 @@ void test_repo_init__relative_gitdir(void)
491
492
cl_git_pass (git_futils_readbuffer (& dot_git_content , "root/b/c_wd/.git" ));
492
493
cl_assert_equal_s ("gitdir: ../my_repository/\n" , dot_git_content .ptr );
493
494
495
+ git_str_dispose (& head_content );
494
496
git_str_dispose (& dot_git_content );
495
497
cleanup_repository ("root" );
496
498
}
@@ -507,8 +509,7 @@ void test_repo_init__relative_gitdir_2(void)
507
509
opts .workdir_path = full_path .ptr ;
508
510
opts .flags =
509
511
GIT_REPOSITORY_INIT_MKPATH |
510
- GIT_REPOSITORY_INIT_RELATIVE_GITLINK |
511
- GIT_REPOSITORY_INIT_NO_DOTGIT_DIR ;
512
+ GIT_REPOSITORY_INIT_RELATIVE_GITLINK ;
512
513
513
514
/* make the directory first, then it should succeed */
514
515
cl_git_pass (git_repository_init_ext (& g_repo , "root/b/my_repository" , & opts ));
0 commit comments