summaryrefslogtreecommitdiff
path: root/src/commit.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-05-22 18:15:42 +0200
committerAndreas Ericsson <ae@op5.se>2010-06-02 10:32:06 +0200
commit36b7cdb6a1a2e685c7141406808366d4c4b9f98e (patch)
treec29a831c884ea240437bd2459e60ffb383dcd149 /src/commit.h
parent89039682651474c6e2bf9abcc02cb71897f8b4e1 (diff)
downloadlibgit2-36b7cdb6a1a2e685c7141406808366d4c4b9f98e.tar.gz
Changed 'git_commit_list' from a linked list to a doubly-linked list.
Changed 'git_commit' to use bit fields instead of flags. 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.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/commit.h b/src/commit.h
index a0c0512a8..75e6d95a8 100644
--- a/src/commit.h
+++ b/src/commit.h
@@ -5,24 +5,33 @@
#include <time.h>
-#define GIT_COMMIT_SEEN (1 << 0)
-#define GIT_COMMIT_HIDE (1 << 1)
-#define GIT_COMMIT_DELAY (1 << 2)
+struct git_commit_node {
+ struct git_commit *commit;
+
+ struct git_commit_node *next;
+ struct git_commit_node *prev;
+};
struct git_commit_list {
- struct git_commit *commit;
- struct git_commit_list *next;
+ struct git_commit_node *head;
+ struct git_commit_node *tail;
+ size_t size;
};
typedef struct git_commit_list git_commit_list;
+typedef struct git_commit_node git_commit_node;
struct git_commit {
git_oid id;
time_t commit_time;
git_revpool *pool;
- git_commit_list *parents;
+ git_commit_list parents;
+ unsigned short in_degree;
unsigned parsed:1,
+ seen:1,
+ uninteresting:1,
+ topo_delay:1,
flags:26;
};
@@ -33,6 +42,9 @@ void git_commit__mark_uninteresting(git_commit *commit);
int git_commit_parse_existing(git_commit *commit);
-void git_commit_list_insert(git_commit_list **list, git_commit *commit);
+void git_commit_list_clear(git_commit_list *list, int free_commits);
+void git_commit_list_append(git_commit_list *list, git_commit *commit);
+git_commit *git_commit_list_pop_back(git_commit_list *list);
+git_commit *git_commit_list_pop_front(git_commit_list *list);
#endif