diff options
Diffstat (limited to 'revision.c')
| -rw-r--r-- | revision.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/revision.c b/revision.c index 0e39b2b8a5..39a25e7a5d 100644 --- a/revision.c +++ b/revision.c @@ -3098,7 +3098,7 @@ static void set_children(struct rev_info *revs) void reset_revision_walk(void) { - clear_object_flags(SEEN | ADDED | SHOWN); + clear_object_flags(SEEN | ADDED | SHOWN | TOPO_WALK_EXPLORED | TOPO_WALK_INDEGREE); } static int mark_uninteresting(const struct object_id *oid, @@ -3211,10 +3211,26 @@ static void compute_indegrees_to_depth(struct rev_info *revs, indegree_walk_step(revs); } +static void reset_topo_walk(struct rev_info *revs) +{ + struct topo_walk_info *info = revs->topo_walk_info; + + clear_prio_queue(&info->explore_queue); + clear_prio_queue(&info->indegree_queue); + clear_prio_queue(&info->topo_queue); + clear_indegree_slab(&info->indegree); + clear_author_date_slab(&info->author_date); + + FREE_AND_NULL(revs->topo_walk_info); +} + static void init_topo_walk(struct rev_info *revs) { struct topo_walk_info *info; struct commit_list *list; + if (revs->topo_walk_info) + reset_topo_walk(revs); + revs->topo_walk_info = xmalloc(sizeof(struct topo_walk_info)); info = revs->topo_walk_info; memset(info, 0, sizeof(struct topo_walk_info)); @@ -3944,7 +3960,7 @@ struct commit *get_revision(struct rev_info *revs) return c; } -char *get_revision_mark(const struct rev_info *revs, const struct commit *commit) +const char *get_revision_mark(const struct rev_info *revs, const struct commit *commit) { if (commit->object.flags & BOUNDARY) return "-"; @@ -3966,7 +3982,7 @@ char *get_revision_mark(const struct rev_info *revs, const struct commit *commit void put_revision_mark(const struct rev_info *revs, const struct commit *commit) { - char *mark = get_revision_mark(revs, commit); + const char *mark = get_revision_mark(revs, commit); if (!strlen(mark)) return; fputs(mark, stdout); |
