summaryrefslogtreecommitdiff
path: root/src/commit.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-09-20 01:57:53 +0300
committerVicent Marti <tanoku@gmail.com>2010-09-20 02:04:06 +0300
commit0c3596f18a6f07d8a61f8d6e2fd730a276a51599 (patch)
tree02add71c1efc95d8c9eead36edca9b2996f5d602 /src/commit.h
parente802d8cca8b7fddb8ae157b84fb7c1e84671546d (diff)
downloadlibgit2-0c3596f18a6f07d8a61f8d6e2fd730a276a51599.tar.gz
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 <tanoku@gmail.com>
Diffstat (limited to 'src/commit.h')
-rw-r--r--src/commit.h18
1 files changed, 5 insertions, 13 deletions
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 <time.h>
-#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);