From d45b4a9a1bcbb157a4f02cf5ed23fde5222db9c8 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Mon, 20 Sep 2010 21:39:11 +0300 Subject: Add support for in-memory objects All repository objects can now be created from scratch in memory using either the git_object_new() method, or the corresponding git_XXX_new() for each object. So far, only git_commits can be written back to disk once created in memory. Signed-off-by: Vicent Marti --- src/git/commit.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/git/commit.h') diff --git a/src/git/commit.h b/src/git/commit.h index 4387925da..a584273a1 100644 --- a/src/git/commit.h +++ b/src/git/commit.h @@ -30,6 +30,18 @@ typedef struct git_commit git_commit; */ GIT_EXTERN(git_commit *) git_commit_lookup(git_repository *repo, const git_oid *id); +/* + * Create a new in-memory git_commit. + * + * The commit object must be manually filled using + * setter methods before it can be written to its + * repository. + * + * @param repo The repository where the object will reside + * @return the object if creation was posible; NULL otherwise + */ +GIT_EXTERN(git_commit *) git_commit_new(git_repository *repo); + /** * Get the id of a commit. * @param commit a previously loaded commit. -- cgit v1.2.1