@@ -2769,7 +2769,8 @@ static void repository_format_configure(struct repository *repo,
27692769 repo_fmt -> ref_storage_payload );
27702770}
27712771
2772- int init_db (const char * git_dir , const char * real_git_dir ,
2772+ int init_db (struct repository * repo ,
2773+ const char * git_dir , const char * real_git_dir ,
27732774 const char * template_dir , int hash ,
27742775 enum ref_storage_format ref_storage_format ,
27752776 const char * initial_branch ,
@@ -2789,13 +2790,13 @@ int init_db(const char *git_dir, const char *real_git_dir,
27892790 if (!exist_ok && !stat (real_git_dir , & st ))
27902791 die (_ ("%s already exists" ), real_git_dir );
27912792
2792- set_git_dir (the_repository , real_git_dir , 1 );
2793- git_dir = repo_get_git_dir (the_repository );
2793+ set_git_dir (repo , real_git_dir , 1 );
2794+ git_dir = repo_get_git_dir (repo );
27942795 separate_git_dir (git_dir , original_git_dir );
27952796 }
27962797 else {
2797- set_git_dir (the_repository , git_dir , 1 );
2798- git_dir = repo_get_git_dir (the_repository );
2798+ set_git_dir (repo , git_dir , 1 );
2799+ git_dir = repo_get_git_dir (repo );
27992800 }
28002801 startup_info -> have_repository = 1 ;
28012802
@@ -2805,57 +2806,57 @@ int init_db(const char *git_dir, const char *real_git_dir,
28052806 * config file, so this will not fail. What we are catching
28062807 * is an attempt to reinitialize new repository with an old tool.
28072808 */
2808- check_repository_format (the_repository , & repo_fmt );
2809+ check_repository_format (repo , & repo_fmt );
28092810
2810- repository_format_configure (the_repository , & repo_fmt , hash , ref_storage_format );
2811+ repository_format_configure (repo , & repo_fmt , hash , ref_storage_format );
28112812
28122813 /*
28132814 * Ensure `core.hidedotfiles` is processed. This must happen after we
28142815 * have set up the repository format such that we can evaluate
28152816 * includeIf conditions correctly in the case of re-initialization.
28162817 */
2817- repo_config (the_repository , git_default_core_config , NULL );
2818+ repo_config (repo , git_default_core_config , NULL );
28182819
2819- safe_create_dir (the_repository , git_dir , 0 );
2820+ safe_create_dir (repo , git_dir , 0 );
28202821
2821- reinit = create_default_files (the_repository , template_dir , original_git_dir ,
2822+ reinit = create_default_files (repo , template_dir , original_git_dir ,
28222823 & repo_fmt , init_shared_repository );
28232824
28242825 if (!(flags & INIT_DB_SKIP_REFDB ))
2825- create_reference_database (the_repository , initial_branch , flags & INIT_DB_QUIET );
2826- create_object_directory (the_repository );
2826+ create_reference_database (repo , initial_branch , flags & INIT_DB_QUIET );
2827+ create_object_directory (repo );
28272828
2828- if (repo_settings_get_shared_repository (the_repository )) {
2829+ if (repo_settings_get_shared_repository (repo )) {
28292830 char buf [10 ];
28302831 /* We do not spell "group" and such, so that
28312832 * the configuration can be read by older version
28322833 * of git. Note, we use octal numbers for new share modes,
28332834 * and compatibility values for PERM_GROUP and
28342835 * PERM_EVERYBODY.
28352836 */
2836- if (repo_settings_get_shared_repository (the_repository ) < 0 )
2837+ if (repo_settings_get_shared_repository (repo ) < 0 )
28372838 /* force to the mode value */
2838- xsnprintf (buf , sizeof (buf ), "0%o" , - repo_settings_get_shared_repository (the_repository ));
2839- else if (repo_settings_get_shared_repository (the_repository ) == PERM_GROUP )
2839+ xsnprintf (buf , sizeof (buf ), "0%o" , - repo_settings_get_shared_repository (repo ));
2840+ else if (repo_settings_get_shared_repository (repo ) == PERM_GROUP )
28402841 xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_GROUP );
2841- else if (repo_settings_get_shared_repository (the_repository ) == PERM_EVERYBODY )
2842+ else if (repo_settings_get_shared_repository (repo ) == PERM_EVERYBODY )
28422843 xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_EVERYBODY );
28432844 else
28442845 BUG ("invalid value for shared_repository" );
2845- repo_config_set (the_repository , "core.sharedrepository" , buf );
2846- repo_config_set (the_repository , "receive.denyNonFastforwards" , "true" );
2846+ repo_config_set (repo , "core.sharedrepository" , buf );
2847+ repo_config_set (repo , "receive.denyNonFastforwards" , "true" );
28472848 }
28482849
28492850 if (!(flags & INIT_DB_QUIET )) {
28502851 int len = strlen (git_dir );
28512852
28522853 if (reinit )
2853- printf (repo_settings_get_shared_repository (the_repository )
2854+ printf (repo_settings_get_shared_repository (repo )
28542855 ? _ ("Reinitialized existing shared Git repository in %s%s\n" )
28552856 : _ ("Reinitialized existing Git repository in %s%s\n" ),
28562857 git_dir , len && git_dir [len - 1 ] != '/' ? "/" : "" );
28572858 else
2858- printf (repo_settings_get_shared_repository (the_repository )
2859+ printf (repo_settings_get_shared_repository (repo )
28592860 ? _ ("Initialized empty shared Git repository in %s%s\n" )
28602861 : _ ("Initialized empty Git repository in %s%s\n" ),
28612862 git_dir , len && git_dir [len - 1 ] != '/' ? "/" : "" );
0 commit comments