summaryrefslogtreecommitdiffstats
path: root/refs.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 /refs.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 'refs.h')
-rw-r--r--refs.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/refs.h b/refs.h
index f8b919a138..f2c4ccde61 100644
--- a/refs.h
+++ b/refs.h
@@ -3,6 +3,7 @@
#include "commit.h"
#include "repository.h"
+#include "repo-settings.h"
struct fsck_options;
struct object_id;
@@ -111,7 +112,8 @@ int refs_verify_refname_available(struct ref_store *refs,
int refs_ref_exists(struct ref_store *refs, const char *refname);
-int should_autocreate_reflog(const char *refname);
+int should_autocreate_reflog(enum log_refs_config log_all_ref_updates,
+ const char *refname);
int is_branch(const char *refname);