summaryrefslogtreecommitdiff
path: root/object-store.h
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-04-12 00:21:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-12 02:38:56 (GMT)
commitc1274495ce74cb71c8c6e9e16490d6c4d2d1fe22 (patch)
treef53addacc3bb497b49ea545d0ad6538c5992dab0 /object-store.h
parent47f351e9b328cd828d85c45a736eca252152aa5c (diff)
downloadgit-c1274495ce74cb71c8c6e9e16490d6c4d2d1fe22.zip
git-c1274495ce74cb71c8c6e9e16490d6c4d2d1fe22.tar.gz
git-c1274495ce74cb71c8c6e9e16490d6c4d2d1fe22.tar.bz2
replace-object: eliminate replace objects prepared flag
Make the oidmap a pointer. That way we eliminate the need for the global boolean variable 'replace_object_prepared' as we can put this information into the pointer being NULL or not. Another advantage of this is that we would more quickly catch code that tries to access replace-map without initializing it. This also allows the '#include "oidmap.h"' introduced in a previous patch to be replaced by the forward declaration of 'struct oidmap;'. Keeping the type opaque discourages circumventing accessor functions; not dragging in other headers avoids some compile time overhead. One disadvantage of this is change is performance as we need to pay the overhead for a malloc. The alternative of moving the global variable into the object store is less modular code. Helped-by: René Scharfe <l.s.r@web.de> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-store.h')
-rw-r--r--object-store.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/object-store.h b/object-store.h
index c04b4c9..1ff862c 100644
--- a/object-store.h
+++ b/object-store.h
@@ -99,7 +99,7 @@ struct raw_object_store {
* Objects that should be substituted by other objects
* (see git-replace(1)).
*/
- struct oidmap replace_map;
+ struct oidmap *replace_map;
/*
* private data