mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
environment: move access to "core.sharedRepository" into repo settings
Similar as with the preceding commit, we track "core.sharedRepository" via a pair of global variables. Move them into `struct repo_settings` so that we can instead track them per-repository. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
6f3fbed8ed
commit
f1ce861c34
@@ -206,32 +206,6 @@ const char *get_commit_output_encoding(void)
|
||||
return git_commit_encoding ? git_commit_encoding : "UTF-8";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void reset_shared_repository(void)
|
||||
{
|
||||
need_shared_repository_from_config = 1;
|
||||
}
|
||||
|
||||
int use_optional_locks(void)
|
||||
{
|
||||
return git_env_bool(GIT_OPTIONAL_LOCKS_ENVIRONMENT, 1);
|
||||
|
||||
Reference in New Issue
Block a user