1#ifndef TREE_H2#define TREE_H34#include "object.h"56extern const char *tree_type;7struct strbuf;89struct tree {10struct object object;11void *buffer;12unsigned long size;13};1415struct tree *lookup_tree(const struct object_id *oid);1617int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);1819int parse_tree_gently(struct tree *tree, int quiet_on_missing);20static inline int parse_tree(struct tree *tree)21{22return parse_tree_gently(tree, 0);23}24void free_tree_buffer(struct tree *tree);2526/* Parses and returns the tree in the given ent, chasing tags and commits. */27struct tree *parse_tree_indirect(const struct object_id *oid);2829#define READ_TREE_RECURSIVE 130typedef int (*read_tree_fn_t)(const unsigned char *, struct strbuf *, const char *, unsigned int, int, void *);3132extern int read_tree_recursive(struct tree *tree,33const char *base, int baselen,34int stage, const struct pathspec *pathspec,35read_tree_fn_t fn, void *context);3637extern int read_tree(struct tree *tree, int stage, struct pathspec *pathspec,38struct index_state *istate);3940#endif /* TREE_H */