From 0c3596f18a6f07d8a61f8d6e2fd730a276a51599 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Mon, 20 Sep 2010 01:57:53 +0300 Subject: Add setter methods & write support for git_commit All the required git_commit_set_XXX methods have been implemented; all the attributes of a commit object can now be modified in-memory. The new method git_object_write() automatically writes back the in-memory changes of any object to the repository. So far it only supports git_commit objects. Signed-off-by: Vicent Marti --- src/commit.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/commit.h') diff --git a/src/commit.h b/src/commit.h index 4e883c074..8039930f7 100644 --- a/src/commit.h +++ b/src/commit.h @@ -7,15 +7,6 @@ #include -#define GIT_COMMIT_TREE (1 << 1) -#define GIT_COMMIT_PARENTS (1 << 2) -#define GIT_COMMIT_AUTHOR (1 << 3) -#define GIT_COMMIT_COMMITTER (1 << 4) -#define GIT_COMMIT_TIME (1 << 5) -#define GIT_COMMIT_MESSAGE (1 << 6) -#define GIT_COMMIT_MESSAGE_SHORT (1 << 7) -#define GIT_COMMIT_FOOTERS (1 << 8) - typedef struct git_commit_parents { git_commit *commit; struct git_commit_parents *next; @@ -34,16 +25,17 @@ struct git_commit { char *message; char *message_short; - unsigned basic_parse:1, - odb_open:1; + unsigned full_parse:1; }; void git_commit__free(git_commit *c); -int git_commit__parse(git_commit *commit, unsigned int flags, int close_odb); -int git_commit__parse_basic(git_commit *commit); +int git_commit__parse(git_commit *commit); +int git_commit__parse_full(git_commit *commit); int git_commit__parse_buffer(git_commit *commit, void *data, size_t len, unsigned int parse_flags); void git_commit__mark_uninteresting(git_commit *commit); +int git_commit__writeback(git_commit *commit, git_odb_source *src); + int git__parse_oid(git_oid *oid, char **buffer_out, const char *buffer_end, const char *header); int git__parse_person(git_person *person, char **buffer_out, const char *buffer_end, const char *header); -- cgit v1.2.1