From 1a895dd787a5699c21d7925e9cdffa66f23605c4 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Sat, 22 May 2010 14:32:59 +0200 Subject: Add arbritrary ordering revision walking. The 'gitrp_next()' method now correctly does a revision walking of all the pushed revisions in arbritary ordering. Signed-off-by: Vicent Marti Signed-off-by: Andreas Ericsson --- src/commit.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/commit.c') diff --git a/src/commit.c b/src/commit.c index fa33b5202..8654e891d 100644 --- a/src/commit.c +++ b/src/commit.c @@ -35,16 +35,15 @@ const git_oid *git_commit_id(git_commit *c) return &c->id; } -void git_commit_mark_uninteresting(git_commit *commit) +void git_commit__mark_uninteresting(git_commit *commit) { + if (commit == NULL) + return; + git_commit_list *parents = commit->parents; commit->flags |= GIT_COMMIT_HIDE; - /* - * FIXME: mark recursively the parents' parents? - * They are most likely not parsed yet... - */ while (parents) { parents->commit->flags |= GIT_COMMIT_HIDE; parents = parents->next; @@ -113,8 +112,6 @@ git_commit *git_commit_lookup(git_revpool *pool, const git_oid *id) git_oid_cpy(&commit->id, id); commit->pool = pool; - git_commit_list_insert(&pool->commits, commit); - return commit; } @@ -187,6 +184,10 @@ int git_commit__parse_buffer(git_commit *commit, void *data, size_t len) if ((parent = git_commit_lookup(commit->pool, &oid)) == NULL) return -1; + // Inherit uninteresting flag + if (commit->flags & GIT_COMMIT_HIDE) + parent->flags |= GIT_COMMIT_HIDE; + git_commit_list_insert(&commit->parents, parent); } -- cgit v1.2.1