summaryrefslogtreecommitdiff
path: root/src/commit.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-03-12 23:09:16 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-14 23:52:32 +0200
commit6b2a19418cb08e7bccefc2362f290a67555594a0 (patch)
tree44e666e45a50a59a444886b70c25c7c954d0ba4f /src/commit.h
parent005718280712634486a097427212e652b0e29f36 (diff)
downloadlibgit2-6b2a19418cb08e7bccefc2362f290a67555594a0.tar.gz
Fix the retarded object interdependency system
It's no longer retarded. All object interdependencies are stored as OIDs instead of actual objects. This should be hundreds of times faster, specially on big repositories. Heck, who knows, maye it doesn't even segfault -- wouldn't that be awesome? What has changed on the API? `git_commit_parent`, `git_commit_tree`, `git_tag_target` now return their values through a pointer-to-pointer, and have an error code. `git_commit_set_tree` and `git_tag_set_target` now return an error code and may fail. `git_repository_free__no_gc` has been deprecated because it's stupid. Since there are no longer any interdependencies between objects, we don't need internal reference counting, and GC never fails or double-free's pointers. `git_object_close` now does a very sane thing: marks an object as unused. Closed objects will be eventually free'd from the object cache based on LRU. Please use `git_object_close` from the garbage collector `destroy` method on your bindings. It's 100% safe. `git_repository_gc` is a new method that forces a garbage collector pass through the repo, to free as many LRU objects as possible. This is useful if we are running out of memory.
Diffstat (limited to 'src/commit.h')
-rw-r--r--src/commit.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/commit.h b/src/commit.h
index b53ee9b23..aaf349ca6 100644
--- a/src/commit.h
+++ b/src/commit.h
@@ -11,21 +11,18 @@
struct git_commit {
git_object object;
- git_vector parents;
+ git_vector parent_oids;
+ git_oid tree_oid;
- git_tree *tree;
git_signature *author;
git_signature *committer;
char *message;
char *message_short;
-
- unsigned full_parse:1;
};
void git_commit__free(git_commit *c);
int git_commit__parse(git_commit *commit);
-int git_commit__parse_full(git_commit *commit);
int git_commit__writeback(git_commit *commit, git_odb_source *src);