tree: stop using the_repository

Push the use of the_repository to the remaining callers by turning the compatibility wrappers into macros, whose use still requires USE_THE_REPOSITORY_VARIABLE to be defined. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Jan 9, 2026 at 22:30 UTC a8a50f29aeab6cf3cd848caaa8229ab26d542b80
2 files changed +3 -18
tree.c
-12
@@ -1,5 +1,3 @@
1 -#define USE_THE_REPOSITORY_VARIABLE
2 -
1 #include "git-compat-util.h"
2 #include "hex.h"
3 #include "tree.h"
@@ -185,11 +183,6 @@ int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size)
183 return 0;
184 }
185
188 -int parse_tree_gently(struct tree *item, int quiet_on_missing)
189 -{
190 - return repo_parse_tree_gently(the_repository, item, quiet_on_missing);
191 -}
192 -
186 int repo_parse_tree_gently(struct repository *r, struct tree *item,
187 int quiet_on_missing)
188 {
@@ -219,11 +212,6 @@ void free_tree_buffer(struct tree *tree)
212 tree->object.parsed = 0;
213 }
214
222 -struct tree *parse_tree_indirect(const struct object_id *oid)
223 -{
224 - return repo_parse_tree_indirect(the_repository, oid);
225 -}
226 -
215 struct tree *repo_parse_tree_indirect(struct repository *r,
216 const struct object_id *oid)
217 {
tree.h
+3 -6
@@ -19,13 +19,10 @@ struct tree *lookup_tree(struct repository *r, const struct object_id *oid);
19
20 int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);
21
22 -int parse_tree_gently(struct tree *tree, int quiet_on_missing);
22 +#define parse_tree_gently(t, q) repo_parse_tree_gently(the_repository, t, q)
23 int repo_parse_tree_gently(struct repository *r, struct tree *item,
24 int quiet_on_missing);
25 -static inline int parse_tree(struct tree *tree)
26 -{
27 - return parse_tree_gently(tree, 0);
28 -}
25 +#define parse_tree(t) repo_parse_tree(the_repository, t)
26 static inline int repo_parse_tree(struct repository *r, struct tree *item)
27 {
28 return repo_parse_tree_gently(r, item, 0);
@@ -33,7 +30,7 @@ static inline int repo_parse_tree(struct repository *r, struct tree *item)
30 void free_tree_buffer(struct tree *tree);
31
32 /* Parses and returns the tree in the given ent, chasing tags and commits. */
36 -struct tree *parse_tree_indirect(const struct object_id *oid);
33 +#define parse_tree_indirect(o) repo_parse_tree_indirect(the_repository, o)
34 struct tree *repo_parse_tree_indirect(struct repository *r,
35 const struct object_id *oid);
36