summaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-11-18 16:47:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-19 01:50:33 (GMT)
commite092073d643b17c82d72cf692fbfaea9c9796f11 (patch)
tree303e6f2f58bf1817a9b0f9365761e86c5bc1053a /tree.h
parent0e94dab5be2fd17cfba634f8a29ba5461d2cbd9e (diff)
downloadgit-e092073d643b17c82d72cf692fbfaea9c9796f11.zip
git-e092073d643b17c82d72cf692fbfaea9c9796f11.tar.gz
git-e092073d643b17c82d72cf692fbfaea9c9796f11.tar.bz2
tree.c: make read_tree*() take 'struct repository *'
These functions call tree_entry_interesting() which will soon require a 'struct index_state *' to be passed in. Instead of just changing the function signature to take an index, update to take a repo instead because these functions do need object database access. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree.h')
-rw-r--r--tree.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/tree.h b/tree.h
index d4807dc..9383745 100644
--- a/tree.h
+++ b/tree.h
@@ -3,7 +3,7 @@
#include "object.h"
-extern const char *tree_type;
+struct repository;
struct strbuf;
struct tree {
@@ -12,6 +12,8 @@ struct tree {
unsigned long size;
};
+extern const char *tree_type;
+
struct tree *lookup_tree(struct repository *r, const struct object_id *oid);
int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);
@@ -29,12 +31,14 @@ struct tree *parse_tree_indirect(const struct object_id *oid);
#define READ_TREE_RECURSIVE 1
typedef int (*read_tree_fn_t)(const struct object_id *, struct strbuf *, const char *, unsigned int, int, void *);
-extern int read_tree_recursive(struct tree *tree,
- const char *base, int baselen,
- int stage, const struct pathspec *pathspec,
- read_tree_fn_t fn, void *context);
+int read_tree_recursive(struct repository *r,
+ struct tree *tree,
+ const char *base, int baselen,
+ int stage, const struct pathspec *pathspec,
+ read_tree_fn_t fn, void *context);
-extern int read_tree(struct tree *tree, int stage, struct pathspec *pathspec,
- struct index_state *istate);
+int read_tree(struct repository *r, struct tree *tree,
+ int stage, struct pathspec *pathspec,
+ struct index_state *istate);
#endif /* TREE_H */