diff --git a/environment.c b/environment.c index b42e2384348523749f5cea8c85f7601ef4a92199..8b8c8e849667548970ccc8225ed2e77d065e2b07 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; } diff --git a/setup.c b/setup.c index ac777c5f10d79527470b52335d6fc48a7ee5c89e..a02932b9698945e04d7a36582f7b5c4bd9fc9268 100644 --- a/setup.c +++ b/setup.c @@ -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,