]>
git.ipfire.org Git - thirdparty/git.git/blob - tree.h
677382eed86c59904153df2f5de02cc51f27e139
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 #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 #define parse_tree(t) repo_parse_tree(the_repository, t)
26 static inline int repo_parse_tree(struct repository
*r
, struct tree
*item
)
28 return repo_parse_tree_gently(r
, item
, 0);
30 void free_tree_buffer(struct tree
*tree
);
32 /* Parses and returns the tree in the given ent, chasing tags and commits. */
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
);
38 * Functions for comparing pathnames
40 int base_name_compare(const char *name1
, size_t len1
, int mode1
,
41 const char *name2
, size_t len2
, int mode2
);
42 int df_name_compare(const char *name1
, size_t len1
, int mode1
,
43 const char *name2
, size_t len2
, int mode2
);
44 int name_compare(const char *name1
, size_t len1
,
45 const char *name2
, size_t len2
);
47 #define READ_TREE_RECURSIVE 1
48 typedef int (*read_tree_fn_t
)(const struct object_id
*, struct strbuf
*, const char *, unsigned int, void *);
50 int read_tree_at(struct repository
*r
,
51 struct tree
*tree
, struct strbuf
*base
,
53 const struct pathspec
*pathspec
,
54 read_tree_fn_t fn
, void *context
);
56 int read_tree(struct repository
*r
,
58 const struct pathspec
*pathspec
,
59 read_tree_fn_t fn
, void *context
);