summaryrefslogtreecommitdiffstats
path: root/setup.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-12 13:30:18 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-12 19:15:43 +0200
commiteafb126456b235c5281e3ae50bfd526552ce12d3 (patch)
tree24fc4c55c9306970a9336196ba3a32d0cc9e1cea /setup.c
parentrefs: stop modifying global `log_all_ref_updates` variable (diff)
downloadgit-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 19cce5afa7..7499191472 100644
--- a/setup.c
+++ b/setup.c
@@ -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);