[PATCH 04/19] 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   | 2 ++
 replace-object.c | 6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/object-store.h b/object-store.h
index da639b3184..be90c02db6 100644
--- a/object-store.h
+++ b/object-store.h
@@ -105,6 +105,8 @@ struct raw_object_store {
 		struct replace_object **items;
 
 		int alloc, nr;
+
+		unsigned prepared : 1;
 	} replacements;
 
 	/*
diff --git a/replace-object.c b/replace-object.c
index a7eb31026e..603d11e931 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.17.0.484.g0c8726318c-goog




[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