From 08d5d00056a7237bf6c60f85a6e72b7549cf9133 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Tue, 18 May 2010 20:55:19 +0200 Subject: Add commit parents to parsed commits and commit lists to the revpool. Basic support for iterating the revpool. The following functions of the revwalk API have been partially implemented: void gitrp_reset(git_revpool *pool); void gitrp_push(git_revpool *pool, git_commit *commit); void gitrp_prepare_walk(git_revpool *pool); git_commit *gitrp_next(git_revpool *pool); Parsed commits' parents are now also parsed and stored in a "git_commit_list" structure (linked list). Signed-off-by: Vicent Marti Signed-off-by: Andreas Ericsson --- src/commit.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/commit.h') diff --git a/src/commit.h b/src/commit.h index fe4db4d4c..7ab2d5413 100644 --- a/src/commit.h +++ b/src/commit.h @@ -9,10 +9,19 @@ #define GIT_COMMIT_HIDE (1 << 1) #define GIT_COMMIT_DELAY (1 << 2) +struct git_commit_list { + struct git_commit *commit; + struct git_commit_list *next; +}; + +typedef struct git_commit_list git_commit_list; + struct git_commit { git_oid id; time_t commit_time; git_revpool *pool; + git_commit_list *parents; + unsigned parsed:1, flags:26; }; @@ -21,4 +30,6 @@ int git_commit__parse_oid(git_oid *oid, char **buffer_out, const char *buffer_en 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); +void git_commit_list_insert(git_commit_list **list, git_commit *commit); + #endif -- cgit v1.2.1