Merge branch 'jk/check-repository-format' into maint

The repository set-up sequence has been streamlined (the biggest
change is that there is no longer git_config_early()), so that we
do not attempt to look into refs/* when we know we do not have a
Git repository.

* jk/check-repository-format:
  verify_repository_format: mark messages for translation
  setup: drop repository_format_version global
  setup: unify repository version callbacks
  init: use setup.c's repo version verification
  setup: refactor repo format reading and verification
  config: drop git_config_early
  check_repository_format_gently: stop using git_config_early
  lazily load core.sharedrepository
  wrap shared_repository global in get/set accessors
  setup: document check_repository_format()
This commit is contained in:
Junio C Hamano
2016-05-02 14:24:04 -07:00
7 changed files with 167 additions and 114 deletions

10
path.c
View File

@ -702,17 +702,17 @@ static int calc_shared_perm(int mode)
{
int tweak;
if (shared_repository < 0)
tweak = -shared_repository;
if (get_shared_repository() < 0)
tweak = -get_shared_repository();
else
tweak = shared_repository;
tweak = get_shared_repository();
if (!(mode & S_IWUSR))
tweak &= ~0222;
if (mode & S_IXUSR)
/* Copy read bits to execute bits */
tweak |= (tweak & 0444) >> 2;
if (shared_repository < 0)
if (get_shared_repository() < 0)
mode = (mode & ~0777) | tweak;
else
mode |= tweak;
@ -725,7 +725,7 @@ int adjust_shared_perm(const char *path)
{
int old_mode, new_mode;
if (!shared_repository)
if (!get_shared_repository())
return 0;
if (get_st_mode_bits(path, &old_mode) < 0)
return -1;