global: prepare for hiding away repo-less config functions

We're about to hide config functions that implicitly depend on `the_repository` behind the `USE_THE_REPOSITORY_VARIABLE` macro. This will uncover a bunch of dependents that transitively relied on the global variable, but didn't define the macro yet. Adapt them such that we define the macro to prepare for this change. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Aug 13, 2024 at 11:14 UTC 219de841d9436d759fa52ea60625b60cda8476fd
23 files changed +45
compat/fsmonitor/fsm-ipc-darwin.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "config.h"
5 #include "gettext.h"
compat/precompose_utf8.c
+1
@@ -4,6 +4,7 @@
4 */
5
6 #define PRECOMPOSE_UNICODE_C
7 +#define USE_THE_REPOSITORY_VARIABLE
8
9 #include "git-compat-util.h"
10 #include "config.h"
connect.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "config.h"
5 #include "environment.h"
credential.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "abspath.h"
5 #include "config.h"
daemon.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "abspath.h"
5 #include "config.h"
editor.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "abspath.h"
5 #include "advice.h"
fsmonitor.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "config.h"
5 #include "dir.h"
gpg-interface.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "commit.h"
5 #include "config.h"
graph.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "gettext.h"
5 #include "config.h"
imap-send.c
+2
@@ -21,6 +21,8 @@
21 * along with this program; if not, see <https://www.gnu.org/licenses/>.
22 */
23
24 +#define USE_THE_REPOSITORY_VARIABLE
25 +
26 #include "git-compat-util.h"
27 #include "config.h"
28 #include "credential.h"
mailinfo.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "config.h"
5 #include "gettext.h"
merge-ll.c
+2
@@ -4,6 +4,8 @@
4 * Copyright (c) 2007 Junio C Hamano
5 */
6
7 +#define USE_THE_REPOSITORY_VARIABLE
8 +
9 #include "git-compat-util.h"
10 #include "config.h"
11 #include "convert.h"
parallel-checkout.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "config.h"
5 #include "entry.h"
protocol.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "config.h"
5 #include "environment.h"
refs.c
+2
@@ -2,6 +2,8 @@
2 * The backend-independent part of the reference module.
3 */
4
5 +#define USE_THE_REPOSITORY_VARIABLE
6 +
7 #include "git-compat-util.h"
8 #include "advice.h"
9 #include "config.h"
refs/packed-backend.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "../git-compat-util.h"
4 #include "../config.h"
5 #include "../dir.h"
refs/reftable-backend.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "../git-compat-util.h"
4 #include "../abspath.h"
5 #include "../chdir-notify.h"
sideband.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "color.h"
5 #include "config.h"
t/helper/test-advise.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "test-tool.h"
4 #include "advice.h"
5 #include "config.h"
t/helper/test-config.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "test-tool.h"
4 #include "config.h"
5 #include "setup.h"
t/helper/test-userdiff.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "test-tool.h"
4 #include "setup.h"
5 #include "userdiff.h"
trailer.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "config.h"
5 #include "environment.h"
versioncmp.c
+2
@@ -1,3 +1,5 @@
1 +#define USE_THE_REPOSITORY_VARIABLE
2 +
3 #include "git-compat-util.h"
4 #include "config.h"
5 #include "strbuf.h"