summaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-05-28 23:05:02 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-05-28 23:05:02 -0700
commit52bc0e294c0d5924db0e5e8f25284e467c6d2983 (patch)
tree86f9e8fe89841de0e69e91902865002dffdaa6bf /tree.h
parentMerge branch 'jc/cache-tree' into next (diff)
parentMerge branch 'lt/tree' into jc/lt-tree-n-cache-tree (diff)
downloadtgif-52bc0e294c0d5924db0e5e8f25284e467c6d2983.tar.xz
Merge branch 'jc/lt-tree-n-cache-tree' into next
* jc/lt-tree-n-cache-tree: Remove "tree->entries" tree-entry list from tree parser Switch "read_tree_recursive()" over to tree-walk functionality Make "tree_entry" have a SHA1 instead of a union of object pointers Add raw tree buffer info to "struct tree" Don't use "sscanf()" for tree mode scanning git-fetch: avoid using "case ... in (arm)"
Diffstat (limited to 'tree.h')
-rw-r--r--tree.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/tree.h b/tree.h
index 330ab64bbd..c7b524861b 100644
--- a/tree.h
+++ b/tree.h
@@ -12,19 +12,19 @@ struct tree_entry_list {
unsigned symlink : 1;
unsigned zeropad : 1;
unsigned int mode;
- char *name;
- union {
- struct object *any;
- struct tree *tree;
- struct blob *blob;
- } item;
+ const char *name;
+ const unsigned char *sha1;
};
struct tree {
struct object object;
- struct tree_entry_list *entries;
+ void *buffer;
+ unsigned long size;
};
+struct tree_entry_list *create_tree_entry_list(struct tree *);
+void free_tree_entry_list(struct tree_entry_list *);
+
struct tree *lookup_tree(const unsigned char *sha1);
int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);
@@ -35,7 +35,7 @@ int parse_tree(struct tree *tree);
struct tree *parse_tree_indirect(const unsigned char *sha1);
#define READ_TREE_RECURSIVE 1
-typedef int (*read_tree_fn_t)(unsigned char *, const char *, int, const char *, unsigned int, int);
+typedef int (*read_tree_fn_t)(const unsigned char *, const char *, int, const char *, unsigned int, int);
extern int read_tree_recursive(struct tree *tree,
const char *base, int baselen,