[PATCH 5/5] repository: drop global `the_index` variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All users of `the_index` have been converted to use either a custom
`struct index_state *` or the index provided by `the_repository`. We can
thus drop the globally-accessible declaration of this variable.

This concludes the quest to make Git `the_index` free, which has started
with 4aab5b46f4 (Make read-cache.c "the_index" free., 2007-04-01).

Signed-off-by: Patrick Steinhardt <ps@xxxxxx>
---
 repository.c | 4 ++--
 repository.h | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/repository.c b/repository.c
index d64d15d952..cbaa6ef7ee 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_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "repository.h"
@@ -23,7 +23,7 @@
 /* The main repository */
 static struct repository the_repo;
 struct repository *the_repository;
-struct index_state the_index;
+static struct index_state the_index;
 
 static void initialize_repository(struct repository *repo,
 				  struct index_state *index)
diff --git a/repository.h b/repository.h
index 268436779c..6f4af15417 100644
--- a/repository.h
+++ b/repository.h
@@ -187,9 +187,6 @@ struct repository {
 };
 
 extern struct repository *the_repository;
-#ifdef USE_THE_INDEX_VARIABLE
-extern struct index_state the_index;
-#endif
 
 /*
  * Define a custom repository layout. Any field can be NULL, which
-- 
2.44.GIT

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux