@@ -2778,7 +2778,8 @@ static void repository_format_configure(struct repository *repo,
27782778 repo_fmt -> ref_storage_payload );
27792779}
27802780
2781- int init_db (const char * git_dir , const char * real_git_dir ,
2781+ int init_db (struct repository * repo ,
2782+ const char * git_dir , const char * real_git_dir ,
27822783 const char * template_dir , int hash ,
27832784 enum ref_storage_format ref_storage_format ,
27842785 const char * initial_branch ,
@@ -2798,13 +2799,13 @@ int init_db(const char *git_dir, const char *real_git_dir,
27982799 if (!exist_ok && !stat (real_git_dir , & st ))
27992800 die (_ ("%s already exists" ), real_git_dir );
28002801
2801- set_git_dir (the_repository , real_git_dir , 1 );
2802- git_dir = repo_get_git_dir (the_repository );
2802+ set_git_dir (repo , real_git_dir , 1 );
2803+ git_dir = repo_get_git_dir (repo );
28032804 separate_git_dir (git_dir , original_git_dir );
28042805 }
28052806 else {
2806- set_git_dir (the_repository , git_dir , 1 );
2807- git_dir = repo_get_git_dir (the_repository );
2807+ set_git_dir (repo , git_dir , 1 );
2808+ git_dir = repo_get_git_dir (repo );
28082809 }
28092810 startup_info -> have_repository = 1 ;
28102811
@@ -2814,57 +2815,57 @@ int init_db(const char *git_dir, const char *real_git_dir,
28142815 * config file, so this will not fail. What we are catching
28152816 * is an attempt to reinitialize new repository with an old tool.
28162817 */
2817- check_repository_format (the_repository , & repo_fmt );
2818+ check_repository_format (repo , & repo_fmt );
28182819
2819- repository_format_configure (the_repository , & repo_fmt , hash , ref_storage_format );
2820+ repository_format_configure (repo , & repo_fmt , hash , ref_storage_format );
28202821
28212822 /*
28222823 * Ensure `core.hidedotfiles` is processed. This must happen after we
28232824 * have set up the repository format such that we can evaluate
28242825 * includeIf conditions correctly in the case of re-initialization.
28252826 */
2826- repo_config (the_repository , git_default_core_config , NULL );
2827+ repo_config (repo , git_default_core_config , NULL );
28272828
2828- safe_create_dir (the_repository , git_dir , 0 );
2829+ safe_create_dir (repo , git_dir , 0 );
28292830
2830- reinit = create_default_files (the_repository , template_dir , original_git_dir ,
2831+ reinit = create_default_files (repo , template_dir , original_git_dir ,
28312832 & repo_fmt , init_shared_repository );
28322833
28332834 if (!(flags & INIT_DB_SKIP_REFDB ))
2834- create_reference_database (the_repository , initial_branch , flags & INIT_DB_QUIET );
2835- create_object_directory (the_repository );
2835+ create_reference_database (repo , initial_branch , flags & INIT_DB_QUIET );
2836+ create_object_directory (repo );
28362837
2837- if (repo_settings_get_shared_repository (the_repository )) {
2838+ if (repo_settings_get_shared_repository (repo )) {
28382839 char buf [10 ];
28392840 /* We do not spell "group" and such, so that
28402841 * the configuration can be read by older version
28412842 * of git. Note, we use octal numbers for new share modes,
28422843 * and compatibility values for PERM_GROUP and
28432844 * PERM_EVERYBODY.
28442845 */
2845- if (repo_settings_get_shared_repository (the_repository ) < 0 )
2846+ if (repo_settings_get_shared_repository (repo ) < 0 )
28462847 /* force to the mode value */
2847- xsnprintf (buf , sizeof (buf ), "0%o" , - repo_settings_get_shared_repository (the_repository ));
2848- else if (repo_settings_get_shared_repository (the_repository ) == PERM_GROUP )
2848+ xsnprintf (buf , sizeof (buf ), "0%o" , - repo_settings_get_shared_repository (repo ));
2849+ else if (repo_settings_get_shared_repository (repo ) == PERM_GROUP )
28492850 xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_GROUP );
2850- else if (repo_settings_get_shared_repository (the_repository ) == PERM_EVERYBODY )
2851+ else if (repo_settings_get_shared_repository (repo ) == PERM_EVERYBODY )
28512852 xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_EVERYBODY );
28522853 else
28532854 BUG ("invalid value for shared_repository" );
2854- repo_config_set (the_repository , "core.sharedrepository" , buf );
2855- repo_config_set (the_repository , "receive.denyNonFastforwards" , "true" );
2855+ repo_config_set (repo , "core.sharedrepository" , buf );
2856+ repo_config_set (repo , "receive.denyNonFastforwards" , "true" );
28562857 }
28572858
28582859 if (!(flags & INIT_DB_QUIET )) {
28592860 int len = strlen (git_dir );
28602861
28612862 if (reinit )
2862- printf (repo_settings_get_shared_repository (the_repository )
2863+ printf (repo_settings_get_shared_repository (repo )
28632864 ? _ ("Reinitialized existing shared Git repository in %s%s\n" )
28642865 : _ ("Reinitialized existing Git repository in %s%s\n" ),
28652866 git_dir , len && git_dir [len - 1 ] != '/' ? "/" : "" );
28662867 else
2867- printf (repo_settings_get_shared_repository (the_repository )
2868+ printf (repo_settings_get_shared_repository (repo )
28682869 ? _ ("Initialized empty shared Git repository in %s%s\n" )
28692870 : _ ("Initialized empty Git repository in %s%s\n" ),
28702871 git_dir , len && git_dir [len - 1 ] != '/' ? "/" : "" );
0 commit comments