16 extern const char *tree_type
;
18 struct tree
*lookup_tree(struct repository
*r
, const struct object_id
*oid
);
20 int parse_tree_buffer(struct tree
*item
, void *buffer
, unsigned long size
);
22 int parse_tree_gently(struct tree
*tree
, int quiet_on_missing
);
23 static inline int parse_tree(struct tree
*tree
)
25 return parse_tree_gently(tree
, 0);
27 void free_tree_buffer(struct tree
*tree
);
29 /* Parses and returns the tree in the given ent, chasing tags and commits. */
30 struct tree
*parse_tree_indirect(const struct object_id
*oid
);
33 * Functions for comparing pathnames
35 int base_name_compare(const char *name1
, size_t len1
, int mode1
,
36 const char *name2
, size_t len2
, int mode2
);
37 int df_name_compare(const char *name1
, size_t len1
, int mode1
,
38 const char *name2
, size_t len2
, int mode2
);
39 int name_compare(const char *name1
, size_t len1
,
40 const char *name2
, size_t len2
);
42 #define READ_TREE_RECURSIVE 1
43 typedef int (*read_tree_fn_t
)(const struct object_id
*, struct strbuf
*, const char *, unsigned int, void *);
45 int read_tree_at(struct repository
*r
,
46 struct tree
*tree
, struct strbuf
*base
,
47 const struct pathspec
*pathspec
,
48 read_tree_fn_t fn
, void *context
);
50 int read_tree(struct repository
*r
,
52 const struct pathspec
*pathspec
,
53 read_tree_fn_t fn
, void *context
);