Skip to content

Commit a52f007

Browse files
committed
revision: "simplify" options imply topo-order sort
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.
1 parent 02101c9 commit a52f007

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

revision.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,11 +1358,13 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
13581358
revs->topo_order = 1;
13591359
} else if (!strcmp(arg, "--simplify-merges")) {
13601360
revs->simplify_merges = 1;
1361+
revs->topo_order = 1;
13611362
revs->rewrite_parents = 1;
13621363
revs->simplify_history = 0;
13631364
revs->limited = 1;
13641365
} else if (!strcmp(arg, "--simplify-by-decoration")) {
13651366
revs->simplify_merges = 1;
1367+
revs->topo_order = 1;
13661368
revs->rewrite_parents = 1;
13671369
revs->simplify_history = 0;
13681370
revs->simplify_by_decoration = 1;
@@ -2016,8 +2018,6 @@ static void simplify_merges(struct rev_info *revs)
20162018
struct commit_list *list;
20172019
struct commit_list *yet_to_do, **tail;
20182020

2019-
if (!revs->topo_order)
2020-
sort_in_topological_order(&revs->commits, revs->lifo);
20212021
if (!revs->prune)
20222022
return;
20232023

0 commit comments

Comments
 (0)