Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/cat-file.c2
-rw-r--r--builtin/difftool.c2
-rw-r--r--builtin/merge-tree.c2
-rw-r--r--builtin/pull.c2
-rw-r--r--cache.h6
-rw-r--r--repository.c2
6 files changed, 10 insertions, 6 deletions
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"
diff --git a/cache.h b/cache.h
index 805e25f9a6..707806d212 100644
--- a/cache.h
+++ b/cache.h
@@ -433,9 +433,11 @@ typedef int (*must_prefetch_predicate)(const struct cache_entry *);
void prefetch_cache_entries(const struct index_state *istate,
must_prefetch_predicate must_prefetch);
-#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS
+#if defined(USE_THE_INDEX_COMPATIBILITY_MACROS) || defined(USE_THE_INDEX_VARIABLE)
extern struct index_state the_index;
+#ifndef USE_THE_INDEX_VARIABLE
+#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS
#define active_nr (the_index.cache_nr)
#define read_cache() repo_read_index(the_repository)
@@ -447,6 +449,8 @@ extern struct index_state the_index;
#define refresh_and_write_cache(refresh_flags, write_flags, gentle) repo_refresh_and_write_index(the_repository, (refresh_flags), (write_flags), (gentle), NULL, NULL, NULL)
#define hold_locked_index(lock_file, flags) repo_hold_locked_index(the_repository, (lock_file), (flags))
#endif
+#endif
+#endif
#define TYPE_BITS 3
diff --git a/repository.c b/repository.c
index 5d166b692c..3427085fd6 100644
--- a/repository.c
+++ b/repository.c
@@ -2,7 +2,7 @@
* not really _using_ the compat macros, just make sure the_index
* declaration matches the definition in this file.
*/
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#define USE_THE_INDEX_VARIABLE
#include "cache.h"
#include "repository.h"
#include "object-store.h"