diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-08-27 16:59:56 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-27 16:59:56 -0700 |
commit | 24343c609926e0163c9956b89c010e907fe755ee (patch) | |
tree | 98155e82f227175aa66405afa6882a84a9e7c46b /revision.c | |
parent | adc542353199bdc0b9b1ed5d03cf881b7efaff6e (diff) | |
parent | b97c470b577071b74315a0e57dd9a03dca120e93 (diff) | |
download | git-24343c609926e0163c9956b89c010e907fe755ee.tar.gz |
Merge branch 'as/maint-graph-interesting-fix'
* as/maint-graph-interesting-fix:
Add tests for rev-list --graph with options that simplify history
graph API: fix bug in graph_is_interesting()
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/revision.c b/revision.c index ce24ad9a8d..35eca4a361 100644 --- a/revision.c +++ b/revision.c @@ -1664,7 +1664,7 @@ static inline int want_ancestry(struct rev_info *revs) return (revs->rewrite_parents || revs->children.name); } -enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit) +enum commit_action get_commit_action(struct rev_info *revs, struct commit *commit) { if (commit->object.flags & SHOWN) return commit_ignore; @@ -1692,12 +1692,23 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit) if (!commit->parents || !commit->parents->next) return commit_ignore; } - if (want_ancestry(revs) && rewrite_parents(revs, commit) < 0) - return commit_error; } return commit_show; } +enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit) +{ + enum commit_action action = get_commit_action(revs, commit); + + if (action == commit_show && + !revs->show_all && + revs->prune && revs->dense && want_ancestry(revs)) { + if (rewrite_parents(revs, commit) < 0) + return commit_error; + } + return action; +} + static struct commit *get_revision_1(struct rev_info *revs) { if (!revs->commits) |