[PATCH 049/194] replace-object: move replace objects prepared flag to object store

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

 



Remove another global variable on the way.

Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx>
---
 object-store.h   | 4 +++-
 replace-object.c | 6 ++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/object-store.h b/object-store.h
index 4ac0ffdb98..e1e592bdd5 100644
--- a/object-store.h
+++ b/object-store.h
@@ -39,6 +39,8 @@ struct object_store {
 		struct replace_object **items;
 
 		int alloc, nr;
+
+		unsigned prepared : 1;
 	} replacements;
 
 	/*
@@ -56,7 +58,7 @@ struct object_store {
 	unsigned packed_git_initialized : 1;
 };
 #define OBJECT_STORE_INIT \
-	{ NULL, MRU_INIT, ALTERNATES_INIT, { NULL, 0, 0 }, 0, 0, 0 }
+	{ NULL, MRU_INIT, ALTERNATES_INIT, { NULL, 0, 0, 0 }, 0, 0, 0 }
 
 struct packed_git {
 	struct packed_git *next;
diff --git a/replace-object.c b/replace-object.c
index cf38c3df00..c865eff0ba 100644
--- a/replace-object.c
+++ b/replace-object.c
@@ -73,13 +73,11 @@ static int register_replace_ref(const char *refname,
 
 static void prepare_replace_object(void)
 {
-	static int replace_object_prepared;
-
-	if (replace_object_prepared)
+	if (the_repository->objects.replacements.prepared)
 		return;
 
 	for_each_replace_ref(register_replace_ref, NULL);
-	replace_object_prepared = 1;
+	the_repository->objects.replacements.prepared = 1;
 	if (!the_repository->objects.replacements.nr)
 		check_replace_refs = 0;
 }
-- 
2.15.1.433.g936d1b9894.dirty




[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