Skip to content

Commit

Permalink
revision: "simplify" options imply topo-order sort
Browse files Browse the repository at this point in the history
The code internally runs sort_in_topo_order() already; it is more clear
to spell it out in the option parsing phase, instead of adding a special
case in simplify_merges() function.
  • Loading branch information
Junio C Hamano committed Jun 8, 2012
1 parent 02101c9 commit a52f007
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,11 +1358,13 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->topo_order = 1;
} else if (!strcmp(arg, "--simplify-merges")) {
revs->simplify_merges = 1;
revs->topo_order = 1;
revs->rewrite_parents = 1;
revs->simplify_history = 0;
revs->limited = 1;
} else if (!strcmp(arg, "--simplify-by-decoration")) {
revs->simplify_merges = 1;
revs->topo_order = 1;
revs->rewrite_parents = 1;
revs->simplify_history = 0;
revs->simplify_by_decoration = 1;
Expand Down Expand Up @@ -2016,8 +2018,6 @@ static void simplify_merges(struct rev_info *revs)
struct commit_list *list;
struct commit_list *yet_to_do, **tail;

if (!revs->topo_order)
sort_in_topological_order(&revs->commits, revs->lifo);
if (!revs->prune)
return;

Expand Down

0 comments on commit a52f007

Please sign in to comment.