@@ -199,13 +199,13 @@ static int create_default_files(const char *template_path)
199199
200200 /* reading existing config may have overwrote it */
201201 if (init_shared_repository != -1 )
202- shared_repository = init_shared_repository ;
202+ set_shared_repository ( init_shared_repository ) ;
203203
204204 /*
205205 * We would have created the above under user's umask -- under
206206 * shared-repository settings, we would need to fix them up.
207207 */
208- if (shared_repository ) {
208+ if (get_shared_repository () ) {
209209 adjust_shared_perm (get_git_dir ());
210210 adjust_shared_perm (git_path_buf (& buf , "refs" ));
211211 adjust_shared_perm (git_path_buf (& buf , "refs/heads" ));
@@ -369,20 +369,20 @@ int init_db(const char *template_dir, unsigned int flags)
369369
370370 create_object_directory ();
371371
372- if (shared_repository ) {
372+ if (get_shared_repository () ) {
373373 char buf [10 ];
374374 /* We do not spell "group" and such, so that
375375 * the configuration can be read by older version
376376 * of git. Note, we use octal numbers for new share modes,
377377 * and compatibility values for PERM_GROUP and
378378 * PERM_EVERYBODY.
379379 */
380- if (shared_repository < 0 )
380+ if (get_shared_repository () < 0 )
381381 /* force to the mode value */
382- xsnprintf (buf , sizeof (buf ), "0%o" , - shared_repository );
383- else if (shared_repository == PERM_GROUP )
382+ xsnprintf (buf , sizeof (buf ), "0%o" , - get_shared_repository () );
383+ else if (get_shared_repository () == PERM_GROUP )
384384 xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_GROUP );
385- else if (shared_repository == PERM_EVERYBODY )
385+ else if (get_shared_repository () == PERM_EVERYBODY )
386386 xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_EVERYBODY );
387387 else
388388 die ("BUG: invalid value for shared_repository" );
@@ -398,7 +398,7 @@ int init_db(const char *template_dir, unsigned int flags)
398398 "", and the last '%s%s' is the verbatim directory name. */
399399 printf (_ ("%s%s Git repository in %s%s\n" ),
400400 reinit ? _ ("Reinitialized existing" ) : _ ("Initialized empty" ),
401- shared_repository ? _ (" shared" ) : "" ,
401+ get_shared_repository () ? _ (" shared" ) : "" ,
402402 git_dir , len && git_dir [len - 1 ] != '/' ? "/" : "" );
403403 }
404404
@@ -493,8 +493,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
493493 * and we know shared_repository should always be 0;
494494 * but just in case we play safe.
495495 */
496- saved = shared_repository ;
497- shared_repository = 0 ;
496+ saved = get_shared_repository () ;
497+ set_shared_repository ( 0 ) ;
498498 switch (safe_create_leading_directories_const (argv [0 ])) {
499499 case SCLD_OK :
500500 case SCLD_PERMS :
@@ -506,7 +506,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
506506 die_errno (_ ("cannot mkdir %s" ), argv [0 ]);
507507 break ;
508508 }
509- shared_repository = saved ;
509+ set_shared_repository ( saved ) ;
510510 if (mkdir (argv [0 ], 0777 ) < 0 )
511511 die_errno (_ ("cannot mkdir %s" ), argv [0 ]);
512512 mkdir_tried = 1 ;
@@ -524,7 +524,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
524524 }
525525
526526 if (init_shared_repository != -1 )
527- shared_repository = init_shared_repository ;
527+ set_shared_repository ( init_shared_repository ) ;
528528
529529 /*
530530 * GIT_WORK_TREE makes sense only in conjunction with GIT_DIR
0 commit comments