diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-09-12 13:30:18 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-09-12 19:15:43 +0200 |
commit | eafb126456b235c5281e3ae50bfd526552ce12d3 (patch) | |
tree | 24fc4c55c9306970a9336196ba3a32d0cc9e1cea /setup.c | |
parent | refs: stop modifying global `log_all_ref_updates` variable (diff) | |
download | git-eafb126456b235c5281e3ae50bfd526552ce12d3.tar.xz git-eafb126456b235c5281e3ae50bfd526552ce12d3.zip |
environment: stop storing "core.logAllRefUpdates" globally
The value of "core.logAllRefUpdates" is being stored in the global
variable `log_all_ref_updates`. This design is somewhat aged nowadays,
where it is entirely possible to access multiple repositories in the
same process which all have different values for this setting. So using
a single global variable to track it is plain wrong.
Remove the global variable. Instead, we now provide a new function part
of the repo-settings subsystem that parses the value for a specific
repository. While that may require us to read the value multiple times,
we work around this by reading it once when the ref backends are set up
and caching the value there.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | setup.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2354,7 +2354,7 @@ static int create_default_files(const char *template_path, else { git_config_set("core.bare", "false"); /* allow template config file to override the default */ - if (log_all_ref_updates == LOG_REFS_UNSET) + if (repo_settings_get_log_all_ref_updates(the_repository) == LOG_REFS_UNSET) git_config_set("core.logallrefupdates", "true"); if (needs_work_tree_config(original_git_dir, work_tree)) git_config_set("core.worktree", work_tree); |