cache.h & test-tool.h: add & use "USE_THE_INDEX_VARIABLE"

In a preceding commit we fully applied the "index-compatibility.pending.cocci" rule to "t/helper/*". Let's now stop defining "USE_THE_INDEX_COMPATIBILITY_MACROS" in test-tool.h itself, and instead instead define "USE_THE_INDEX_VARIABLE" in the individual test helpers that need it. This mirrors how we do the same thing in the "builtin/" directory. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Nov 19, 2022 at 14:07 UTC bdafeae0b9cdbf5b33c116564ffec93389cc5d37
10 files changed +9 -3
t/helper/test-cache-tree.c
+1
@@ -1,3 +1,4 @@
1 +#define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "tree.h"
t/helper/test-dump-cache-tree.c
+1
@@ -1,3 +1,4 @@
1 +#define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "tree.h"
t/helper/test-dump-split-index.c
+1
@@ -1,3 +1,4 @@
1 +#define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "split-index.h"
t/helper/test-dump-untracked-cache.c
+1 -1
@@ -1,4 +1,4 @@
1 -#define USE_THE_INDEX_COMPATIBILITY_MACROS
1 +#define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "dir.h"
t/helper/test-fast-rebase.c
+1 -1
@@ -10,7 +10,7 @@
10 * refactoring is the better route).
11 */
12
13 -#define USE_THE_INDEX_COMPATIBILITY_MACROS
13 +#define USE_THE_INDEX_VARIABLE
14 #include "test-tool.h"
15
16 #include "cache-tree.h"
t/helper/test-lazy-init-name-hash.c
+1
@@ -1,3 +1,4 @@
1 +#define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "parse-options.h"
t/helper/test-read-cache.c
+1
@@ -1,3 +1,4 @@
1 +#define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "config.h"
t/helper/test-scrap-cache-tree.c
+1
@@ -1,3 +1,4 @@
1 +#define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "lockfile.h"
t/helper/test-tool.h
-1
@@ -1,7 +1,6 @@
1 #ifndef TEST_TOOL_H
2 #define TEST_TOOL_H
3
4 -#define USE_THE_INDEX_COMPATIBILITY_MACROS
4 #include "git-compat-util.h"
5
6 int cmd__advise_if_enabled(int argc, const char **argv);
t/helper/test-write-cache.c
+1
@@ -1,3 +1,4 @@
1 +#define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "lockfile.h"