]> git.scripts.mit.edu Git - git.git/commitdiff
cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 24 Jan 2019 08:29:12 +0000 (15:29 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Jan 2019 19:55:06 +0000 (11:55 -0800)
By default, index compat macros are off from now on, because they
could hide the_index dependency.

Only those in builtin can use it.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
55 files changed:
attr.c
builtin/add.c
builtin/am.c
builtin/blame.c
builtin/cat-file.c
builtin/check-attr.c
builtin/check-ignore.c
builtin/checkout-index.c
builtin/checkout.c
builtin/clean.c
builtin/clone.c
builtin/commit.c
builtin/describe.c
builtin/diff-files.c
builtin/diff-index.c
builtin/diff-tree.c
builtin/diff.c
builtin/difftool.c
builtin/fsck.c
builtin/grep.c
builtin/hash-object.c
builtin/log.c
builtin/ls-files.c
builtin/merge-index.c
builtin/merge-ours.c
builtin/merge-tree.c
builtin/merge.c
builtin/mv.c
builtin/pack-objects.c
builtin/pull.c
builtin/read-tree.c
builtin/rebase--interactive.c
builtin/rebase.c
builtin/replace.c
builtin/reset.c
builtin/rev-parse.c
builtin/rm.c
builtin/submodule--helper.c
builtin/update-index.c
builtin/write-tree.c
cache-tree.h
cache.h
convert.c
dir.c
git.c
name-hash.c
pathspec.c
read-cache.c
repository.c
submodule.c
t/helper/test-dump-fsmonitor.c
t/helper/test-dump-untracked-cache.c
t/helper/test-tool.h
tree.c
unpack-trees.c

diff --git a/attr.c b/attr.c
index b63fe0fc0e99caa07dc2e6da816e1ac8d5942df6..e4e4574857dd086301279cbac51a4e11fb65f093 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -7,7 +7,6 @@
  * an insanely large number of attributes.
  */
 
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "exec-cmd.h"
index f65c1722993b62e93feb85e506dffbc77b7ce921..81df0d34dec18bfded5100075ebffc1a19a3f48e 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2006 Linus Torvalds
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "builtin.h"
index a9ffc92eaada7fc6e47a793ab515fd55273650d0..ad913ef20e18b177055a0d10895b267b9128b82f 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Based on git-am.sh by Junio C Hamano.
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "builtin.h"
index 6d798f99392e54b4392713846652111d457787bb..0074ed311c8b6c26770f62a668f51abda316ec46 100644 (file)
@@ -1007,7 +1007,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
                long bottom, top;
                if (parse_range_arg(range_list.items[range_i].string,
                                    nth_line_cb, &sb, lno, anchor,
-                                   &bottom, &top, sb.path, &the_index))
+                                   &bottom, &top, sb.path,
+                                   the_repository->index))
                        usage(blame_usage);
                if ((!lno && (top || bottom)) || lno < bottom)
                        die(Q_("file %s has only %lu line",
index 7622c502f0090ddec9c094514eed93b5b1c81e53..a5ca47c697e6ef363a40224916fd451554120fb8 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "builtin.h"
index 30a2f84274d32977769f778d5704accb599cf0e7..dd833977864d79a3abde9fc66042d7bda56b8e82 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "cache.h"
 #include "config.h"
index ec9a959e08d0e3dfa0d2b08529cacbe8d2e04c6e..599097304b77fa5a3f464b8831e71d6a3f56077a 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "cache.h"
 #include "config.h"
index eb74774cbc9d6bd6acf1b7fe2f31b8e80e461a12..345591bc4b5c5462e18046face3f8ce956483c9a 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (C) 2005 Linus Torvalds
  *
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "config.h"
 #include "lockfile.h"
index a95ba2c6dc153610569476bfa545967913f71a8e..0446cac05e72befa69f61ff200fbd17befa7796f 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "config.h"
 #include "checkout.h"
index bbcdeb2d9e7f275309609a2a21a5dd4baf1cf1bd..aaba4af3c26de2150ad655a0b162fc85a69a466d 100644 (file)
@@ -6,6 +6,7 @@
  * Based on git-clean.sh by Pavel Roskin
  */
 
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "cache.h"
 #include "config.h"
index 7c7f98c72c80cfcb12f3d3f61a13f46b19967a8f..ddb3230d2165c7969e8192520cb17be567835354 100644 (file)
@@ -8,6 +8,7 @@
  * Clone a repository into a different directory that does not yet exist.
  */
 
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "config.h"
 #include "lockfile.h"
index d3f1234bf058d9c4ab4c1ad610cec580cc7f1250..2f4af02a27281ca9b7dc7cd579c53680f9d41b56 100644 (file)
@@ -5,6 +5,7 @@
  * Based on git-commit.sh by Junio C Hamano and Linus Torvalds
  */
 
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "lockfile.h"
index bc97e50650a39e03448c1c4e5dd0e8f880b9befc..02ec56417a197b7e252625561fa462a215499a4d 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "lockfile.h"
index 48cfcb935d0413fcf3850e0c28ec237b642b38a2..86ae474fbfb410f026d42ce9f36e9805a98cfc82 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "diff.h"
index fcccd1f10dc95cd47a994b5139226af438049f87..93ec6424234c65f486dcfca724c77a48e5e91f91 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "diff.h"
index 42bc1eb41db8287ab9f64445ec2a151f216d8840..a90681bcbafcba04af3b669f0758c78ccecdd11f 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "diff.h"
index ec78920ee24fccd47a20d1b7b93a619695c1be25..74351a5757d399ddf251369a5be67bedbe2dfad7 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (c) 2006 Junio C Hamano
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "lockfile.h"
index 544b0e86397cb98ddfdad3cffdd983905ee36029..eeb9e370b9c5b3d11fb9f4774aee7cdf952e3b51 100644 (file)
@@ -11,6 +11,7 @@
  *
  * Copyright (C) 2016 Johannes Schindelin
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "builtin.h"
index bf5ddff43f74e0dba77d05e04bc14c0c59884287..46f6ea9baa909bf5aeec43a08461ad2328d5eb13 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "cache.h"
 #include "repository.h"
index fc7a9a928302f79d26fd4d0f57c32f8efd7b9f6e..39a8e9d4a35a02e3bba8c43f77def39fa8f75bb2 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (c) 2006 Junio C Hamano
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "repository.h"
 #include "config.h"
index d6f06ea32f51272efa5ccb3fdd396b5916e98e45..e055c1110310bc3b6ccef4fa83dae84316fcc75f 100644 (file)
@@ -40,7 +40,8 @@ static void hash_fd(int fd, const char *type, const char *path, unsigned flags,
        if (fstat(fd, &st) < 0 ||
            (literally
             ? hash_literally(&oid, fd, type, flags)
-            : index_fd(&the_index, &oid, fd, &st, type_from_string(type), path, flags)))
+            : index_fd(the_repository->index, &oid, fd, &st,
+                       type_from_string(type), path, flags)))
                die((flags & HASH_WRITE_OBJECT)
                    ? "Unable to add %s to database"
                    : "Unable to hash %s", path);
index dbfb4e31ad7e031d41ef2b9718336c788a96e806..195ff0b4713fd3b126125a56b30814f12bb8b4c9 100644 (file)
@@ -4,6 +4,7 @@
  * (C) Copyright 2006 Linus Torvalds
  *              2006 Junio Hamano
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "refs.h"
index c70a9c71588a76b2ef04689fc6cd805cee4ae0b8..7cc7ec22c96d30bed42b67279de1413115f47689 100644 (file)
@@ -5,7 +5,6 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "repository.h"
 #include "config.h"
index c99443b095bd8abbe02d4ea87a452d916681c53f..38ea6ad6ca25d5a969afdbfc5b3510ba44e49a33 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "run-command.h"
 
index 0b07263415785e11c7fc5b1a6da40a25e969b73c..4594507420533262a7b6611386a340cfdb96b25f 100644 (file)
@@ -7,6 +7,7 @@
  *
  * Pretend we resolved the heads, but declare our tree trumps everybody else.
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "git-compat-util.h"
 #include "builtin.h"
 #include "diff.h"
index 70f6fc916765c5a5ca67c2dfe72e0480128182e3..53719e0b9d3f9eb683b0809488ea354391639a58 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "tree-walk.h"
 #include "xdiff-interface.h"
@@ -76,7 +77,8 @@ static void *result(struct merge_list *entry, unsigned long *size)
        their = NULL;
        if (entry)
                their = entry->blob;
-       return merge_blobs(&the_index, path, base, our, their, size);
+       return merge_blobs(the_repository->index, path,
+                          base, our, their, size);
 }
 
 static void *origin(struct merge_list *entry, unsigned long *size)
index bc1aecfe70cfd97d3589d6a0280ca3c68bc31f1c..e47d77baeebe888cfb67f8e03804ffc3ee3715c0 100644 (file)
@@ -6,6 +6,7 @@
  * Based on git-merge.sh by Junio C Hamano.
  */
 
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "parse-options.h"
index 80bb967a63f154eb44ebc1a6dd7f833d01dce83e..be15ba7044e0eeeee216a9e6c4615214cd7cdc1e 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2006 Johannes Schindelin
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "config.h"
 #include "pathspec.h"
index 24bba8147fc96ec2b124aa659c981af08e7a688d..d9d3b90b23935eb6bc2bdefa52f43b917cb7d152 100644 (file)
@@ -970,7 +970,7 @@ static int no_try_delta(const char *path)
 
        if (!check)
                check = attr_check_initl("delta", NULL);
-       git_check_attr(&the_index, path, check);
+       git_check_attr(the_repository->index, path, check);
        if (ATTR_FALSE(check->items[0].value))
                return 1;
        return 0;
index 74808b94554a78e720128a721f21dc0d20dd839e..701d1473dc59e018247f337d37f00fe04f83cb98 100644 (file)
@@ -5,6 +5,7 @@
  *
  * Fetch one or more remote refs and merge it/them into the current HEAD.
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "builtin.h"
index ac255ad2c243192a9afd3b4578a2a501eb250aff..9083dcfa28a38f7f804c1fdcaa56fb4260b4e6f0 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "lockfile.h"
index dd2a55ab1d956ef0937cfdb0e4e3fb026ac2ff81..6895322d613afcf3cebb0ded610c45ab343ef688 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "cache.h"
 #include "config.h"
index 7124e66d00e817fd74d1e5876454aea7e0f34a4e..b66783727628c3867683236e5afeef247c5054f4 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2018 Pratik Karki
  */
 
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "run-command.h"
 #include "exec-cmd.h"
index affcdfb4169899c2affee51593f0453d5d9b9add..5b80b7f21141d6f85d8444d669dffe289f3a60f5 100644 (file)
@@ -295,7 +295,7 @@ static int import_object(struct object_id *oid, enum object_type type,
                        close(fd);
                        return -1;
                }
-               if (index_fd(&the_index, oid, fd, &st, type, NULL, flags) < 0)
+               if (index_fd(the_repository->index, oid, fd, &st, type, NULL, flags) < 0)
                        return error(_("unable to write object to database"));
                /* index_fd close()s fd for us */
        }
index 59898c972eee5e8065c2a68b7c937cc3af11f513..4d18a461fab631dd752adec3b95197a3a2657a62 100644 (file)
@@ -7,6 +7,7 @@
  *
  * Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "config.h"
 #include "lockfile.h"
index 910a71ed8b7997a4d1317f9a2bf048bc2617040a..f8bbe6d47ec397f55bec62d6a71bc6db8f08b54b 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "commit.h"
index 17086d3d97c536522720c589ea8f35d366536ea8..db85b339823cc0aa5ab5d03220335d4e4240d656 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) Linus Torvalds 2006
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "config.h"
 #include "lockfile.h"
index b45514be317eafb765a8943241b5d880f65e3117..9c832fc606d636f141ec806cf0281489ea199885 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "repository.h"
 #include "cache.h"
index e19da77edcaa024cc2bffc6fa8818c2b1cf0d4b6..02ace602b9ae23d6ab74abac016948410b30fcde 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "lockfile.h"
index cdcbf8264e8c6e9b56977b99ad28160754d8fb7c..3d46d22ee5261d2cf1233913b7b544e812c26122 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "cache.h"
 #include "config.h"
index 326209198b60fa8a6fdbd171c46132b8a5062e04..757bbc48bca155fe539d07a268087b96ae7aa7f6 100644 (file)
@@ -51,7 +51,7 @@ void prime_cache_tree(struct repository *, struct index_state *, struct tree *);
 
 int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info);
 
-#ifndef NO_THE_INDEX_COMPATIBILITY_MACROS
+#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS
 static inline int write_cache_as_tree(struct object_id *oid, int flags, const char *prefix)
 {
        return write_index_as_tree(oid, &the_index, get_index_file(), flags, prefix);
diff --git a/cache.h b/cache.h
index 326e73f391abec77a3f0fb2bacca40abafebc6bc..962eb127d3a9e51e3a4cb3911a856320af26f2a4 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -338,8 +338,6 @@ struct index_state {
        struct mem_pool *ce_mem_pool;
 };
 
-extern struct index_state the_index;
-
 /* Name hashing */
 extern int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
 extern void add_name_hash(struct index_state *istate, struct cache_entry *ce);
@@ -401,7 +399,9 @@ struct cache_entry *dup_cache_entry(const struct cache_entry *ce, struct index_s
  */
 void validate_cache_entries(const struct index_state *istate);
 
-#ifndef NO_THE_INDEX_COMPATIBILITY_MACROS
+#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS
+extern struct index_state the_index;
+
 #define active_cache (the_index.cache)
 #define active_nr (the_index.cache_nr)
 #define active_alloc (the_index.cache_alloc)
index e0848226d21bbbeb26d9ac6217fe1e61ccc71fca..df8c6a0bf86097ca0d9864b4ec5233fb0b1c5939 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1,4 +1,3 @@
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "object-store.h"
diff --git a/dir.c b/dir.c
index ab6477d777e96cb9789f1c6b3220af349731a701..80e07441f7eb893b898e5481427fb6f100402fc4 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -7,7 +7,6 @@
  * Copyright (C) Linus Torvalds, 2005-2006
  *              Junio Hamano, 2005-2006
  */
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "dir.h"
diff --git a/git.c b/git.c
index 4d53a3d50da0c699ca83babdf12122532c3eafe9..0c2b26979743946f26b607d90884287aea68836b 100644 (file)
--- a/git.c
+++ b/git.c
@@ -417,9 +417,9 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
 
        trace_argv_printf(argv, "trace: built-in: git");
 
-       validate_cache_entries(&the_index);
+       validate_cache_entries(the_repository->index);
        status = p->fn(argc, argv, prefix);
-       validate_cache_entries(&the_index);
+       validate_cache_entries(the_repository->index);
 
        if (status)
                return status;
index 623ca6923a9ec78b9bb7d7cc899af72057d101d3..b4861bc7b02a93bd5f3659098764f535bb1f51c1 100644 (file)
@@ -5,7 +5,6 @@
  *
  * Copyright (C) 2008 Linus Torvalds
  */
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "thread-utils.h"
 
index 6f005996fdc8f3e412b0faafc12e65aed359be3b..f1505cfd0af0eb5969d1623cec1bf197be95fb27 100644 (file)
@@ -1,4 +1,3 @@
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "dir.h"
index 2549477ed27a7f56b6ee27e44d2345e42a5a8738..b3865d688493b5cc2522a33bd4c3d0975226fb1a 100644 (file)
@@ -3,7 +3,6 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "diff.h"
@@ -95,7 +94,6 @@ static struct mem_pool *find_mem_pool(struct index_state *istate)
        return *pool_ptr;
 }
 
-struct index_state the_index;
 static const char *alternate_index_output;
 
 static void set_index_entry(struct index_state *istate, int nr, struct cache_entry *ce)
index 9411c4baee2f49e7ce561bc3e142e4bffd521733..36a3b52d709a4516a7987c2c64288dc523adf415 100644 (file)
@@ -1,3 +1,8 @@
+/*
+ * not really _using_ the compat macros, just make sure the_index
+ * declaration matches the definition in this file.
+ */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "repository.h"
 #include "object-store.h"
@@ -9,6 +14,7 @@
 /* The main repository */
 static struct repository the_repo;
 struct repository *the_repository;
+struct index_state the_index;
 
 void initialize_the_repository(void)
 {
index 6415cc55807c7ed9ee4cbcaa57f41a5804b6e854..4208a502603ff8f763dd959610500eb718a76383 100644 (file)
@@ -1,4 +1,3 @@
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 
 #include "cache.h"
 #include "repository.h"
index 08e3684aff223670fb0786d80426d18bb8800a44..2786f47088e975608c839f193527e1e70e84cee9 100644 (file)
@@ -3,11 +3,11 @@
 
 int cmd__dump_fsmonitor(int ac, const char **av)
 {
-       struct index_state *istate = &the_index;
+       struct index_state *istate = the_repository->index;
        int i;
 
        setup_git_directory();
-       if (do_read_index(istate, get_index_file(), 0) < 0)
+       if (do_read_index(istate, the_repository->index_file, 0) < 0)
                die("unable to read index file");
        if (!istate->fsmonitor_last_update) {
                printf("no fsmonitor\n");
index 52870ebbb3ea7b2d69aecb1bb429dbbaf6388b51..cf0f2c7228e8293c5982168f21b004bc7daa2ff0 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "test-tool.h"
 #include "cache.h"
 #include "dir.h"
index 042f12464b2a17afeb37e01d90bf49ba33ce879a..f4fb3b986156f5b786120fd4eaea2c0c9093f381 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef TEST_TOOL_H
 #define TEST_TOOL_H
 
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "git-compat-util.h"
 
 int cmd__chmtime(int argc, const char **argv);
diff --git a/tree.c b/tree.c
index 215d3fdc7c4af2ef2faca1cf5d5d0b5de52b84a8..181a3778f37d2bbbc6d69a37d93936988ae67cc2 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -1,4 +1,3 @@
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "cache-tree.h"
 #include "tree.h"
index 6d53cbfc865096ea41028c0601aa12d6eeb8a145..40f554814d30c8f2cbd91f1d34c618a3d567ac17 100644 (file)
@@ -1,4 +1,3 @@
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "argv-array.h"
 #include "repository.h"