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 10:15:43 -0700 |
| commit | eafb126456b235c5281e3ae50bfd526552ce12d3 (patch) | |
| tree | 24fc4c55c9306970a9336196ba3a32d0cc9e1cea /repo-settings.h | |
| parent | refs: stop modifying global `log_all_ref_updates` variable (diff) | |
| download | git-eafb126456b235c5281e3ae50bfd526552ce12d3.tar.gz 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 'repo-settings.h')
| -rw-r--r-- | repo-settings.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/repo-settings.h b/repo-settings.h index d03b6e57f0..76adb96a66 100644 --- a/repo-settings.h +++ b/repo-settings.h @@ -65,4 +65,7 @@ struct repo_settings { void prepare_repo_settings(struct repository *r); +/* Read the value for "core.logAllRefUpdates". */ +enum log_refs_config repo_settings_get_log_all_ref_updates(struct repository *repo); + #endif /* REPO_SETTINGS_H */ |
