From 666f53eb43f52216d03d579b91a2152ba7821773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 19 Nov 2022 14:07:36 +0100 Subject: {builtin/*,repository}.c: add & use "USE_THE_INDEX_VARIABLE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Split up the "USE_THE_INDEX_COMPATIBILITY_MACROS" into that setting and a more narrow "USE_THE_INDEX_VARIABLE". In the case of these built-ins we only need "the_index" variable, but not the compatibility wrapper for functions we're not using. Let's then have some users of "USE_THE_INDEX_COMPATIBILITY_MACROS" use this more narrow and descriptive define. For context: The USE_THE_INDEX_COMPATIBILITY_MACROS macro was added to test-tool.h in f8adbec9fea (cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch, 2019-01-24). Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- builtin/cat-file.c | 2 +- builtin/difftool.c | 2 +- builtin/merge-tree.c | 2 +- builtin/pull.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'builtin') diff --git a/builtin/cat-file.c b/builtin/cat-file.c index fa7bd89169..b3be58b1fb 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -3,7 +3,7 @@ * * Copyright (C) Linus Torvalds, 2005 */ -#define USE_THE_INDEX_COMPATIBILITY_MACROS +#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "config.h" #include "builtin.h" diff --git a/builtin/difftool.c b/builtin/difftool.c index d7f08c8a7f..d9b76226f6 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -11,7 +11,7 @@ * * Copyright (C) 2016 Johannes Schindelin */ -#define USE_THE_INDEX_COMPATIBILITY_MACROS +#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "config.h" #include "builtin.h" diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index fe853aa8f9..e3767087bb 100644 --- a/builtin/merge-tree.c +++ b/builtin/merge-tree.c @@ -1,4 +1,4 @@ -#define USE_THE_INDEX_COMPATIBILITY_MACROS +#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "tree-walk.h" #include "xdiff-interface.h" diff --git a/builtin/pull.c b/builtin/pull.c index 4a2a6db2dc..1ab4de0005 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -5,7 +5,7 @@ * * Fetch one or more remote refs and merge it/them into the current HEAD. */ -#define USE_THE_INDEX_COMPATIBILITY_MACROS +#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "config.h" #include "builtin.h" -- cgit v1.2.3