@@ -2775,7 +2775,8 @@ static void repository_format_configure(struct repository *repo,
27752775 repo_fmt -> ref_storage_payload );
27762776}
27772777
2778- int init_db (const char * git_dir , const char * real_git_dir ,
2778+ int init_db (struct repository * repo ,
2779+ const char * git_dir , const char * real_git_dir ,
27792780 const char * template_dir , int hash ,
27802781 enum ref_storage_format ref_storage_format ,
27812782 const char * initial_branch ,
@@ -2795,13 +2796,13 @@ int init_db(const char *git_dir, const char *real_git_dir,
27952796 if (!exist_ok && !stat (real_git_dir , & st ))
27962797 die (_ ("%s already exists" ), real_git_dir );
27972798
2798- set_git_dir (the_repository , real_git_dir , 1 );
2799- git_dir = repo_get_git_dir (the_repository );
2799+ set_git_dir (repo , real_git_dir , 1 );
2800+ git_dir = repo_get_git_dir (repo );
28002801 separate_git_dir (git_dir , original_git_dir );
28012802 }
28022803 else {
2803- set_git_dir (the_repository , git_dir , 1 );
2804- git_dir = repo_get_git_dir (the_repository );
2804+ set_git_dir (repo , git_dir , 1 );
2805+ git_dir = repo_get_git_dir (repo );
28052806 }
28062807 startup_info -> have_repository = 1 ;
28072808
@@ -2811,57 +2812,57 @@ int init_db(const char *git_dir, const char *real_git_dir,
28112812 * config file, so this will not fail. What we are catching
28122813 * is an attempt to reinitialize new repository with an old tool.
28132814 */
2814- check_repository_format (the_repository , & repo_fmt );
2815+ check_repository_format (repo , & repo_fmt );
28152816
2816- repository_format_configure (the_repository , & repo_fmt , hash , ref_storage_format );
2817+ repository_format_configure (repo , & repo_fmt , hash , ref_storage_format );
28172818
28182819 /*
28192820 * Ensure `core.hidedotfiles` is processed. This must happen after we
28202821 * have set up the repository format such that we can evaluate
28212822 * includeIf conditions correctly in the case of re-initialization.
28222823 */
2823- repo_config (the_repository , git_default_core_config , NULL );
2824+ repo_config (repo , git_default_core_config , NULL );
28242825
2825- safe_create_dir (the_repository , git_dir , 0 );
2826+ safe_create_dir (repo , git_dir , 0 );
28262827
2827- reinit = create_default_files (the_repository , template_dir , original_git_dir ,
2828+ reinit = create_default_files (repo , template_dir , original_git_dir ,
28282829 & repo_fmt , init_shared_repository );
28292830
28302831 if (!(flags & INIT_DB_SKIP_REFDB ))
2831- create_reference_database (the_repository , initial_branch , flags & INIT_DB_QUIET );
2832- create_object_directory (the_repository );
2832+ create_reference_database (repo , initial_branch , flags & INIT_DB_QUIET );
2833+ create_object_directory (repo );
28332834
2834- if (repo_settings_get_shared_repository (the_repository )) {
2835+ if (repo_settings_get_shared_repository (repo )) {
28352836 char buf [10 ];
28362837 /* We do not spell "group" and such, so that
28372838 * the configuration can be read by older version
28382839 * of git. Note, we use octal numbers for new share modes,
28392840 * and compatibility values for PERM_GROUP and
28402841 * PERM_EVERYBODY.
28412842 */
2842- if (repo_settings_get_shared_repository (the_repository ) < 0 )
2843+ if (repo_settings_get_shared_repository (repo ) < 0 )
28432844 /* force to the mode value */
2844- xsnprintf (buf , sizeof (buf ), "0%o" , - repo_settings_get_shared_repository (the_repository ));
2845- else if (repo_settings_get_shared_repository (the_repository ) == PERM_GROUP )
2845+ xsnprintf (buf , sizeof (buf ), "0%o" , - repo_settings_get_shared_repository (repo ));
2846+ else if (repo_settings_get_shared_repository (repo ) == PERM_GROUP )
28462847 xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_GROUP );
2847- else if (repo_settings_get_shared_repository (the_repository ) == PERM_EVERYBODY )
2848+ else if (repo_settings_get_shared_repository (repo ) == PERM_EVERYBODY )
28482849 xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_EVERYBODY );
28492850 else
28502851 BUG ("invalid value for shared_repository" );
2851- repo_config_set (the_repository , "core.sharedrepository" , buf );
2852- repo_config_set (the_repository , "receive.denyNonFastforwards" , "true" );
2852+ repo_config_set (repo , "core.sharedrepository" , buf );
2853+ repo_config_set (repo , "receive.denyNonFastforwards" , "true" );
28532854 }
28542855
28552856 if (!(flags & INIT_DB_QUIET )) {
28562857 int len = strlen (git_dir );
28572858
28582859 if (reinit )
2859- printf (repo_settings_get_shared_repository (the_repository )
2860+ printf (repo_settings_get_shared_repository (repo )
28602861 ? _ ("Reinitialized existing shared Git repository in %s%s\n" )
28612862 : _ ("Reinitialized existing Git repository in %s%s\n" ),
28622863 git_dir , len && git_dir [len - 1 ] != '/' ? "/" : "" );
28632864 else
2864- printf (repo_settings_get_shared_repository (the_repository )
2865+ printf (repo_settings_get_shared_repository (repo )
28652866 ? _ ("Initialized empty shared Git repository in %s%s\n" )
28662867 : _ ("Initialized empty Git repository in %s%s\n" ),
28672868 git_dir , len && git_dir [len - 1 ] != '/' ? "/" : "" );
0 commit comments