diff options
-rw-r--r-- | environment.c | 9 | ||||
-rw-r--r-- | setup.c | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/environment.c b/environment.c index b42e238434..8b8c8e8496 100644 --- a/environment.c +++ b/environment.c @@ -326,13 +326,22 @@ const char *get_commit_output_encoding(void) } static int the_shared_repository = PERM_UMASK; +static int need_shared_repository_from_config = 1; void set_shared_repository(int value) { the_shared_repository = value; + need_shared_repository_from_config = 0; } int get_shared_repository(void) { + if (need_shared_repository_from_config) { + const char *var = "core.sharedrepository"; + const char *value; + if (!git_config_get_value(var, &value)) + the_shared_repository = git_config_perm(var, value); + need_shared_repository_from_config = 0; + } return the_shared_repository; } @@ -376,8 +376,6 @@ static int check_repo_format(const char *var, const char *value, void *cb) if (strcmp(var, "core.repositoryformatversion") == 0) repository_format_version = git_config_int(var, value); - else if (strcmp(var, "core.sharedrepository") == 0) - set_shared_repository(git_config_perm(var, value)); else if (skip_prefix(var, "extensions.", &ext)) { /* * record any known extensions here; otherwise, |