]>
Commit | Line | Data |
---|---|---|
06160502 SP |
1 | #ifndef INCLUDE_git_commit_h__ |
2 | #define INCLUDE_git_commit_h__ | |
3 | ||
257bd746 AE |
4 | #include "common.h" |
5 | #include "oid.h" | |
06160502 SP |
6 | |
7 | /** | |
d1ea30c3 | 8 | * @file git/commit.h |
06160502 SP |
9 | * @brief Git commit parsing, formatting routines |
10 | * @defgroup git_commit Git commit parsing, formatting routines | |
11 | * @ingroup Git | |
12 | * @{ | |
13 | */ | |
14 | GIT_BEGIN_DECL | |
15 | ||
16 | /** Parsed representation of a commit object. */ | |
6533aadc | 17 | typedef struct git_commit git_commit; |
06160502 SP |
18 | |
19 | /** | |
417f0abc | 20 | * Lookup a commit from a revision pool, and parse it if needed. |
06160502 SP |
21 | * @param pool the pool to use when parsing/caching the commit. |
22 | * @param id identity of the commit to locate. If the object is | |
23 | * an annotated tag it will be peeled back to the commit. | |
24 | * @return the commit; NULL if the commit does not exist in the | |
6533aadc | 25 | * pool's git_odb, or if the commit is present but is |
06160502 SP |
26 | * too malformed to be parsed successfully. |
27 | */ | |
417f0abc | 28 | GIT_EXTERN(git_commit *) git_commit_lookup(git_revpool *pool, const git_oid *id); |
06160502 SP |
29 | |
30 | /** | |
31 | * Get the id of a commit. | |
32 | * @param commit a previously parsed commit. | |
33 | * @return object identity for the commit. | |
34 | */ | |
1e5dd572 | 35 | GIT_EXTERN(const git_oid *) git_commit_id(git_commit *commit); |
06160502 | 36 | |
06160502 SP |
37 | /** @} */ |
38 | GIT_END_DECL | |
39 | #endif |