From 417f0abc9b41f01520df863567b25efd03bd281c Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Fri, 14 May 2010 18:44:49 +0200 Subject: 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 Signed-off-by: Andreas Ericsson --- src/commit.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/commit.h') 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 +#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 -- cgit v1.2.1