diff options
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r-- | include/git2/tree.h | 55 |
1 files changed, 10 insertions, 45 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h index 982646628..777f8ff0d 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2011 the libgit2 contributors + * Copyright (C) 2009-2012 the libgit2 contributors * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. @@ -27,7 +27,7 @@ GIT_BEGIN_DECL * @param tree pointer to the looked up tree * @param repo the repo to use when locating the tree. * @param id identity of the tree to locate. - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_INLINE(int) git_tree_lookup(git_tree **tree, git_repository *repo, const git_oid *id) { @@ -44,7 +44,7 @@ GIT_INLINE(int) git_tree_lookup(git_tree **tree, git_repository *repo, const git * @param repo the repo to use when locating the tree. * @param id identity of the tree to locate. * @param len the length of the short identifier - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_INLINE(int) git_tree_lookup_prefix(git_tree **tree, git_repository *repo, const git_oid *id, unsigned int len) { @@ -141,9 +141,9 @@ GIT_EXTERN(git_otype) git_tree_entry_type(const git_tree_entry *entry); * @param object pointer to the converted object * @param repo repository where to lookup the pointed object * @param entry a tree entry - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ -GIT_EXTERN(int) git_tree_entry_2object(git_object **object_out, git_repository *repo, const git_tree_entry *entry); +GIT_EXTERN(int) git_tree_entry_to_object(git_object **object_out, git_repository *repo, const git_tree_entry *entry); /** * Write a tree to the ODB from the index file @@ -159,7 +159,7 @@ GIT_EXTERN(int) git_tree_entry_2object(git_object **object_out, git_repository * * * @param oid Pointer where to store the written tree * @param index Index to write - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_EXTERN(int) git_tree_create_fromindex(git_oid *oid, git_index *index); @@ -229,7 +229,7 @@ GIT_EXTERN(const git_tree_entry *) git_treebuilder_get(git_treebuilder *bld, con * @param filename Filename of the entry * @param id SHA1 oid of the entry * @param attributes Folder attributes of the entry - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_EXTERN(int) git_treebuilder_insert(git_tree_entry **entry_out, git_treebuilder *bld, const char *filename, const git_oid *id, unsigned int attributes); @@ -264,7 +264,7 @@ GIT_EXTERN(void) git_treebuilder_filter(git_treebuilder *bld, int (*filter)(cons * @param oid Pointer where to store the written OID * @param repo Repository where to store the object * @param bld Tree builder to write - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_EXTERN(int) git_treebuilder_write(git_oid *oid, git_repository *repo, git_treebuilder *bld); @@ -278,8 +278,7 @@ GIT_EXTERN(int) git_treebuilder_write(git_oid *oid, git_repository *repo, git_tr * @param subtree Pointer where to store the subtree * @param root A previously loaded tree which will be the root of the relative path * @param subtree_path Path to the contained subtree - * @return GIT_SUCCESS on success; GIT_ENOTFOUND if the path does not lead to a - * subtree, GIT_EINVALIDPATH or an error code + * @return 0 on success; GIT_ENOTFOUND if the path does not lead to a subtree */ GIT_EXTERN(int) git_tree_get_subtree(git_tree **subtree, git_tree *root, const char *subtree_path); @@ -309,45 +308,11 @@ enum git_treewalk_mode { * @param callback Function to call on each tree entry * @param mode Traversal mode (pre or post-order) * @param payload Opaque pointer to be passed on each callback - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_EXTERN(int) git_tree_walk(git_tree *tree, git_treewalk_cb callback, int mode, void *payload); /** @} */ -typedef enum { - GIT_STATUS_ADDED = 1, - GIT_STATUS_DELETED = 2, - GIT_STATUS_MODIFIED = 3, -} git_status_t; - -typedef struct { - unsigned int old_attr; - unsigned int new_attr; - git_oid old_oid; - git_oid new_oid; - git_status_t status; - const char *path; -} git_tree_diff_data; - -typedef int (*git_tree_diff_cb)(const git_tree_diff_data *ptr, void *data); - -/** - * Diff two trees - * - * Compare two trees. For each difference in the trees, the callback - * will be called with a git_tree_diff_data filled with the relevant - * information. - * - * @param old the "old" tree - * @param newer the "newer" tree - * @param cb callback - * @param data data to give to the callback - * @return GIT_SUCCESS or an error code - */ -int git_tree_diff(git_tree *old, git_tree *newer, git_tree_diff_cb cb, void *data); - -int git_tree_diff_index_recursive(git_tree *tree, git_index *index, git_tree_diff_cb cb, void *data); - GIT_END_DECL #endif |