]> Kevux Git Server - rit/commit
refs: stop modifying global `log_all_ref_updates` variable
authorPatrick Steinhardt <ps@pks.im>
Thu, 12 Sep 2024 11:30:13 +0000 (13:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Sep 2024 17:15:43 +0000 (10:15 -0700)
commit9a20b889e8703482162d9d1487b876be42564a78
tree04e8121ac4dbbb63b03559b6b8485ae285065f73
parent118fd1a26da681d33dfc65e9dbf74e2dda0c5b3e
refs: stop modifying global `log_all_ref_updates` variable

In refs-related code we modify the global `log_all_ref_updates`
variable, which is done because `should_autocreate_reflog()` does not
accept passing an `enum log_refs_config` but instead accesses the global
variable. Adapt its interface such that the value is provided by the
caller, which allows us to compute the proper value locally without
having to modify global state.

This change requires us to move the enum to "repo-settings.h", or
otherwise we get compilation errors due to include cycles. We're about
to fully move this setting into the repo-settings subsystem anyway, so
this is fine.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c
environment.h
refs.c
refs.h
refs/files-backend.c
refs/reftable-backend.c
repo-settings.h