diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-05-18 20:55:19 +0200 |
---|---|---|
committer | Andreas Ericsson <ae@op5.se> | 2010-06-02 10:32:06 +0200 |
commit | 08d5d00056a7237bf6c60f85a6e72b7549cf9133 (patch) | |
tree | b47ba8387c1d7209d4976af9c3928f6ce93ed545 /src/commit.h | |
parent | 42281e007e15713713b2ff4324d60360332e194e (diff) | |
download | libgit2-08d5d00056a7237bf6c60f85a6e72b7549cf9133.tar.gz |
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 <tanoku@gmail.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
Diffstat (limited to 'src/commit.h')
-rw-r--r-- | src/commit.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 |