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>
This commit is contained in:

committed by
Junio C Hamano

parent
9a20b889e8
commit
eafb126456
@ -951,6 +951,8 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
|
||||
const char *old_desc, *reflog_msg;
|
||||
if (opts->new_branch) {
|
||||
if (opts->new_orphan_branch) {
|
||||
enum log_refs_config log_all_ref_updates =
|
||||
repo_settings_get_log_all_ref_updates(the_repository);
|
||||
char *refname;
|
||||
|
||||
refname = mkpathdup("refs/heads/%s", opts->new_orphan_branch);
|
||||
|
Reference in New Issue
Block a user