diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-02-10 11:28:38 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-10 11:38:14 -0800 |
commit | fcb864bce70573380e6409c4ca25d1bdf16b0841 (patch) | |
tree | a443ad93e150ee0aa0e5c8a1111fa35dc092ce7c /cache-tree.h | |
parent | 99370863e20131627f0ea0481b7006d0d2125c93 (diff) | |
download | git-fcb864bce70573380e6409c4ca25d1bdf16b0841.tar.gz |
cache-tree API: remove redundant update_main_cache_tree()
Remove the redundant update_main_cache_tree() function, and make its
users use cache_tree_update() instead.
The behavior of populating the "the_index.cache_tree" if it wasn't
present already was needed when this function was introduced in [1],
but it hasn't been needed since [2]; The "cache_tree_update()" will
now lazy-allocate, so there's no need for the wrapper.
1. 996277c5206 (Refactor cache_tree_update idiom from commit,
2011-12-06)
2. fb0882648e0 (cache-tree: clean up cache_tree_update(), 2021-01-23)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache-tree.h')
-rw-r--r-- | cache-tree.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/cache-tree.h b/cache-tree.h index 84890c9ff3..bd97caa07b 100644 --- a/cache-tree.h +++ b/cache-tree.h @@ -53,14 +53,4 @@ int write_index_as_tree(struct object_id *oid, struct index_state *index_state, 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); - -#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS -static inline int update_main_cache_tree(int flags) -{ - if (!the_index.cache_tree) - the_index.cache_tree = cache_tree(); - return cache_tree_update(&the_index, flags); -} -#endif - #endif |