]> git.proxmox.com Git - libgit2.git/blob - src/git/tree.h
Redesigned the walking/object lookup interface
[libgit2.git] / src / git / tree.h
1 #ifndef INCLUDE_git_tree_h__
2 #define INCLUDE_git_tree_h__
3
4 #include "common.h"
5 #include "oid.h"
6 #include "repository.h"
7
8 /**
9 * @file git/tree.h
10 * @brief Git tree parsing, loading routines
11 * @defgroup git_tree Git tree parsing, loading routines
12 * @ingroup Git
13 * @{
14 */
15 GIT_BEGIN_DECL
16
17 /** Representation of a tree object. */
18 typedef struct git_tree git_tree;
19
20 /**
21 * Lookup a tree object from the repository.
22 * The generated tree object is owned by the revision
23 * repo and shall not be freed by the user.
24 *
25 * @param repo the repo to use when locating the tree.
26 * @param id identity of the tree to locate.
27 * @return the tree; NULL if the tree could not be created
28 */
29 GIT_EXTERN(git_tree *) git_tree_lookup(git_repository *repo, const git_oid *id);
30
31 /**
32 * Get the id of a tree.
33 * @param tree a previously loaded tree.
34 * @return object identity for the tree.
35 */
36 GIT_EXTERN(const git_oid *) git_tree_id(git_tree *tree);
37
38 /** @} */
39 GIT_END_DECL
40 #endif