diff options
Diffstat (limited to 'src/tree.h')
-rw-r--r-- | src/tree.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/tree.h b/src/tree.h index 498a90d66..b77bfd961 100644 --- a/src/tree.h +++ b/src/tree.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2012 the libgit2 contributors + * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. @@ -13,11 +13,11 @@ #include "vector.h" struct git_tree_entry { - unsigned int attr; - char *filename; + uint16_t removed; + uint16_t attr; git_oid oid; size_t filename_len; - int removed; + char filename[1]; }; struct git_tree { @@ -27,14 +27,16 @@ struct git_tree { struct git_treebuilder { git_vector entries; + size_t entrycount; /* vector may contain "removed" entries */ }; - GIT_INLINE(bool) git_tree_entry__is_tree(const struct git_tree_entry *e) { return (S_ISDIR(e->attr) && !S_ISGITLINK(e->attr)); } +extern int git_tree_entry_icmp(const git_tree_entry *e1, const git_tree_entry *e2); + void git_tree__free(git_tree *tree); int git_tree__parse(git_tree *tree, git_odb_object *obj); @@ -48,4 +50,15 @@ int git_tree__parse(git_tree *tree, git_odb_object *obj); int git_tree__prefix_position(git_tree *tree, const char *prefix); +/** + * Write a tree to the given repository + */ +int git_tree__write_index( + git_oid *oid, git_index *index, git_repository *repo); + +/** + * Obsolete mode kept for compatibility reasons + */ +#define GIT_FILEMODE_BLOB_GROUP_WRITABLE 0100664 + #endif |