diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-05-14 18:44:49 +0200 |
---|---|---|
committer | Andreas Ericsson <ae@op5.se> | 2010-06-02 10:32:06 +0200 |
commit | 417f0abc9b41f01520df863567b25efd03bd281c (patch) | |
tree | 0ebbc36594071221b685805590415d74624f41e3 /src/commit.h | |
parent | 1bb11859357114684a1a740e471edf1a7541b82a (diff) | |
download | libgit2-417f0abc9b41f01520df863567b25efd03bd281c.tar.gz |
Add basic functionality for commit lookup/parsing
The external API function "git_commit_parse" has been renamed
to "git_commit_lookup" and has been partially implemented with
support for loading commits straight from the ODB. It still lacks
the functionality to lookup cached commits in the revpool and to
resolve tags to commits.
The following internal functions have been partially implemented:
int git_commit__parse_buffer(...);
int git_commit__parse_time(...);
int git_commit__parse_oid(...);
Commits are now fully parsed but the generated parent and tree
references are not handled yet.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
Diffstat (limited to 'src/commit.h')
-rw-r--r-- | src/commit.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/commit.h b/src/commit.h index 05504cd34..1cdb9a4f4 100644 --- a/src/commit.h +++ b/src/commit.h @@ -5,11 +5,20 @@ #include <time.h> +#define GIT_COMMIT_SEEN (1 << 0) +#define GIT_COMMIT_HIDE (1 << 1) +#define GIT_COMMIT_DELAY (1 << 2) + struct git_commit { git_oid id; time_t commit_time; + git_revpool *pool; unsigned parsed:1, flags:26; }; +int git_commit__parse_oid(git_oid *oid, char **buffer_out, const char *buffer_end, const char *header); +int git_commit__parse_buffer(git_commit *commit, void *data, size_t len); +int git_commit__parse_time(time_t *commit_time, char *buffer, const char *buffer_end); + #endif |