summaryrefslogtreecommitdiffstats
path: root/prompt.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-12 13:30:01 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-12 19:15:42 +0200
commit673af418d0f271faadb24486348430e547d32d2a (patch)
tree350e205229a62ed858d512a2b578ef36bf49cb98 /prompt.c
parentenvironment: reorder header to split out `the_repository`-free section (diff)
downloadgit-673af418d0f271faadb24486348430e547d32d2a.tar.xz
git-673af418d0f271faadb24486348430e547d32d2a.zip
environment: guard state depending on a repository
In "environment.h" we have quite a lot of functions and variables that either explicitly or implicitly depend on `the_repository`. The implicit set of stateful declarations includes for example variables which get populated when parsing a repository's Git configuration. This set of variables is broken by design, as their state often depends on the last repository config that has been parsed. So they may or may not represent the state of `the_repository`. Fixing that is quite a big undertaking, and later patches in this series will demonstrate a solution for a first small set of those variables. So for now, let's guard these with `USE_THE_REPOSITORY_VARIABLE` so that callers are aware of the implicit dependency. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'prompt.c')
-rw-r--r--prompt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/prompt.c b/prompt.c
index 8935fe4dfb..f21c5bf1c7 100644
--- a/prompt.c
+++ b/prompt.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "parse.h"
#include "environment.h"