]> git.proxmox.com Git - libgit2.git/blame - src/git/tree.h
Add loading and parsing of tag objects
[libgit2.git] / src / git / tree.h
CommitLineData
225fe215
VM
1#ifndef INCLUDE_git_tree_h__
2#define INCLUDE_git_tree_h__
3
4#include "common.h"
5#include "oid.h"
6
7/**
8 * @file git/tree.h
9 * @brief Git tree parsing, loading routines
10 * @defgroup git_tree Git tree parsing, loading routines
11 * @ingroup Git
12 * @{
13 */
14GIT_BEGIN_DECL
15
16/** Representation of a tree object. */
17typedef struct git_tree git_tree;
18
19/**
20 * Locate a reference to a tree without loading it.
21 * The generated tree object is owned by the revision
22 * pool and shall not be freed by the user.
23 *
24 * @param pool the pool to use when locating the tree.
25 * @param id identity of the tree to locate.
26 * @return the tree; NULL if the tree could not be created
27 */
28GIT_EXTERN(git_tree *) git_tree_lookup(git_revpool *pool, const git_oid *id);
29
d8603ed9
VM
30/**
31 * Locate a reference to a tree object and parse its
32 * contents.
33 * The generated tree object is owned by the revision
34 * pool and shall not be freed by the user.
35 *
36 * @param pool the pool to use when locating the tree.
37 * @param id identity of the tree to locate.
38 * @return the tree; NULL if the tree could not be created
39 */
40GIT_EXTERN(git_tree *) git_tree_parse(git_revpool *pool, const git_oid *id);
41
225fe215
VM
42/**
43 * Get the id of a tree.
44 * @param tree a previously loaded tree.
45 * @return object identity for the tree.
46 */
47GIT_EXTERN(const git_oid *) git_tree_id(git_tree *tree);
48
49/** @} */
50GIT_END_DECL
51#endif