diff options
author | Jeff King <peff@peff.net> | 2016-03-11 17:36:49 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-03-11 15:02:17 -0800 |
commit | 7875acb6ecf85a7dc29554d193955ce5e265764f (patch) | |
tree | 58b24619636ee321eaea313575b92e83dc636f0e /environment.c | |
parent | 4b0d1eebe95b8ed187ff06ae46d69d517c2b759f (diff) | |
download | git-7875acb6ecf85a7dc29554d193955ce5e265764f.tar.gz |
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>
Diffstat (limited to 'environment.c')
-rw-r--r-- | environment.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/environment.c b/environment.c index 6dec9d0403..b42e238434 100644 --- a/environment.c +++ b/environment.c @@ -29,7 +29,6 @@ int repository_format_version; int repository_format_precious_objects; const char *git_commit_encoding; const char *git_log_output_encoding; -int shared_repository = PERM_UMASK; const char *apply_default_whitespace; const char *apply_default_ignorewhitespace; const char *git_attributes_file; @@ -325,3 +324,15 @@ const char *get_commit_output_encoding(void) { return git_commit_encoding ? git_commit_encoding : "UTF-8"; } + +static int the_shared_repository = PERM_UMASK; + +void set_shared_repository(int value) +{ + the_shared_repository = value; +} + +int get_shared_repository(void) +{ + return the_shared_repository; +} |