diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-05-22 14:32:59 +0200 |
---|---|---|
committer | Andreas Ericsson <ae@op5.se> | 2010-06-02 10:32:06 +0200 |
commit | 1a895dd787a5699c21d7925e9cdffa66f23605c4 (patch) | |
tree | 57b5df4e635d8324ca75b0dd33cb96271b426e23 /src/commit.c | |
parent | 8add01539268300564482f854412cfe9839e980c (diff) | |
download | libgit2-1a895dd787a5699c21d7925e9cdffa66f23605c4.tar.gz |
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 <tanoku@gmail.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
Diffstat (limited to 'src/commit.c')
-rw-r--r-- | src/commit.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/commit.c b/src/commit.c index fa33b520..8654e891 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); } |