summaryrefslogtreecommitdiffstats
path: root/repo-settings.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-12 13:30:13 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-12 19:15:43 +0200
commit9a20b889e8703482162d9d1487b876be42564a78 (patch)
tree04e8121ac4dbbb63b03559b6b8485ae285065f73 /repo-settings.h
parentbranch: stop modifying `log_all_ref_updates` variable (diff)
downloadgit-9a20b889e8703482162d9d1487b876be42564a78.tar.xz
git-9a20b889e8703482162d9d1487b876be42564a78.zip
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>
Diffstat (limited to '')
-rw-r--r--repo-settings.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/repo-settings.h b/repo-settings.h
index 28f95695b3..d03b6e57f0 100644
--- a/repo-settings.h
+++ b/repo-settings.h
@@ -16,6 +16,13 @@ enum fetch_negotiation_setting {
FETCH_NEGOTIATION_NOOP,
};
+enum log_refs_config {
+ LOG_REFS_UNSET = -1,
+ LOG_REFS_NONE = 0,
+ LOG_REFS_NORMAL,
+ LOG_REFS_ALWAYS
+};
+
struct repo_settings {
int initialized;