From bdafeae0b9cdbf5b33c116564ffec93389cc5d37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 19 Nov 2022 14:07:37 +0100 Subject: [PATCH] cache.h & test-tool.h: add & use "USE_THE_INDEX_VARIABLE" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- t/helper/test-cache-tree.c | 1 + t/helper/test-dump-cache-tree.c | 1 + t/helper/test-dump-split-index.c | 1 + t/helper/test-dump-untracked-cache.c | 2 +- t/helper/test-fast-rebase.c | 2 +- t/helper/test-lazy-init-name-hash.c | 1 + t/helper/test-read-cache.c | 1 + t/helper/test-scrap-cache-tree.c | 1 + t/helper/test-tool.h | 1 - t/helper/test-write-cache.c | 1 + 10 files changed, 9 insertions(+), 3 deletions(-) diff --git a/t/helper/test-cache-tree.c b/t/helper/test-cache-tree.c index 5514afdfe7..9159a17301 100644 --- a/t/helper/test-cache-tree.c +++ b/t/helper/test-cache-tree.c @@ -1,3 +1,4 @@ +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" #include "tree.h" diff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c index 4bf8bc3df6..454f17b1a0 100644 --- a/t/helper/test-dump-cache-tree.c +++ b/t/helper/test-dump-cache-tree.c @@ -1,3 +1,4 @@ +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" #include "tree.h" diff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c index a209880eb3..0ea97b8407 100644 --- a/t/helper/test-dump-split-index.c +++ b/t/helper/test-dump-split-index.c @@ -1,3 +1,4 @@ +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" #include "split-index.h" diff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c index ffe34736e5..6d53683f13 100644 --- a/t/helper/test-dump-untracked-cache.c +++ b/t/helper/test-dump-untracked-cache.c @@ -1,4 +1,4 @@ -#define USE_THE_INDEX_COMPATIBILITY_MACROS +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" #include "dir.h" diff --git a/t/helper/test-fast-rebase.c b/t/helper/test-fast-rebase.c index 9def2ba688..efc82dd80c 100644 --- a/t/helper/test-fast-rebase.c +++ b/t/helper/test-fast-rebase.c @@ -10,7 +10,7 @@ * refactoring is the better route). */ -#define USE_THE_INDEX_COMPATIBILITY_MACROS +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache-tree.h" diff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c index 7e8723a190..ab86c14c8b 100644 --- a/t/helper/test-lazy-init-name-hash.c +++ b/t/helper/test-lazy-init-name-hash.c @@ -1,3 +1,4 @@ +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" #include "parse-options.h" diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c index a089be9104..23e9e27109 100644 --- a/t/helper/test-read-cache.c +++ b/t/helper/test-read-cache.c @@ -1,3 +1,4 @@ +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" #include "config.h" diff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c index 9206dee1fd..a26107ed70 100644 --- a/t/helper/test-scrap-cache-tree.c +++ b/t/helper/test-scrap-cache-tree.c @@ -1,3 +1,4 @@ +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" #include "lockfile.h" diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h index da7cd6351a..2e20a16eb8 100644 --- a/t/helper/test-tool.h +++ b/t/helper/test-tool.h @@ -1,7 +1,6 @@ #ifndef TEST_TOOL_H #define TEST_TOOL_H -#define USE_THE_INDEX_COMPATIBILITY_MACROS #include "git-compat-util.h" int cmd__advise_if_enabled(int argc, const char **argv); diff --git a/t/helper/test-write-cache.c b/t/helper/test-write-cache.c index 66287d6d47..7d45cd61e8 100644 --- a/t/helper/test-write-cache.c +++ b/t/helper/test-write-cache.c @@ -1,3 +1,4 @@ +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" #include "lockfile.h" -- 2.39.5