wrap shared_repository global in get/set accessors

It would be useful to control access to the global
shared_repository, so that we can lazily load its config.
The first step to doing so is to make sure all access
goes through a set of functions.

This step is purely mechanical, and should result in no
change of behavior.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2016-03-11 17:36:49 -05:00
committed by Junio C Hamano
parent 4b0d1eebe9
commit 7875acb6ec
5 changed files with 33 additions and 20 deletions

View File

@ -377,7 +377,7 @@ 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)
shared_repository = git_config_perm(var, value);
set_shared_repository(git_config_perm(var, value));
else if (skip_prefix(var, "extensions.", &ext)) {
/*
* record any known extensions here; otherwise,