@@ -199,13 +199,13 @@ static int create_default_files(const char *template_path)
199
199
200
200
/* reading existing config may have overwrote it */
201
201
if (init_shared_repository != -1 )
202
- shared_repository = init_shared_repository ;
202
+ set_shared_repository ( init_shared_repository ) ;
203
203
204
204
/*
205
205
* We would have created the above under user's umask -- under
206
206
* shared-repository settings, we would need to fix them up.
207
207
*/
208
- if (shared_repository ) {
208
+ if (get_shared_repository () ) {
209
209
adjust_shared_perm (get_git_dir ());
210
210
adjust_shared_perm (git_path_buf (& buf , "refs" ));
211
211
adjust_shared_perm (git_path_buf (& buf , "refs/heads" ));
@@ -369,20 +369,20 @@ int init_db(const char *template_dir, unsigned int flags)
369
369
370
370
create_object_directory ();
371
371
372
- if (shared_repository ) {
372
+ if (get_shared_repository () ) {
373
373
char buf [10 ];
374
374
/* We do not spell "group" and such, so that
375
375
* the configuration can be read by older version
376
376
* of git. Note, we use octal numbers for new share modes,
377
377
* and compatibility values for PERM_GROUP and
378
378
* PERM_EVERYBODY.
379
379
*/
380
- if (shared_repository < 0 )
380
+ if (get_shared_repository () < 0 )
381
381
/* 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 )
384
384
xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_GROUP );
385
- else if (shared_repository == PERM_EVERYBODY )
385
+ else if (get_shared_repository () == PERM_EVERYBODY )
386
386
xsnprintf (buf , sizeof (buf ), "%d" , OLD_PERM_EVERYBODY );
387
387
else
388
388
die ("BUG: invalid value for shared_repository" );
@@ -398,7 +398,7 @@ int init_db(const char *template_dir, unsigned int flags)
398
398
"", and the last '%s%s' is the verbatim directory name. */
399
399
printf (_ ("%s%s Git repository in %s%s\n" ),
400
400
reinit ? _ ("Reinitialized existing" ) : _ ("Initialized empty" ),
401
- shared_repository ? _ (" shared" ) : "" ,
401
+ get_shared_repository () ? _ (" shared" ) : "" ,
402
402
git_dir , len && git_dir [len - 1 ] != '/' ? "/" : "" );
403
403
}
404
404
@@ -493,8 +493,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
493
493
* and we know shared_repository should always be 0;
494
494
* but just in case we play safe.
495
495
*/
496
- saved = shared_repository ;
497
- shared_repository = 0 ;
496
+ saved = get_shared_repository () ;
497
+ set_shared_repository ( 0 ) ;
498
498
switch (safe_create_leading_directories_const (argv [0 ])) {
499
499
case SCLD_OK :
500
500
case SCLD_PERMS :
@@ -506,7 +506,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
506
506
die_errno (_ ("cannot mkdir %s" ), argv [0 ]);
507
507
break ;
508
508
}
509
- shared_repository = saved ;
509
+ set_shared_repository ( saved ) ;
510
510
if (mkdir (argv [0 ], 0777 ) < 0 )
511
511
die_errno (_ ("cannot mkdir %s" ), argv [0 ]);
512
512
mkdir_tried = 1 ;
@@ -524,7 +524,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
524
524
}
525
525
526
526
if (init_shared_repository != -1 )
527
- shared_repository = init_shared_repository ;
527
+ set_shared_repository ( init_shared_repository ) ;
528
528
529
529
/*
530
530
* GIT_WORK_TREE makes sense only in conjunction with GIT_DIR
0 commit comments