revision --simplify-merges: make it a no-op without pathspec

When we are not pruning there is no reason to run the merge
simplification.

Also avoid running topo-order sort twice.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2008-08-14 13:52:36 -07:00
parent 53030f8d11
commit 5eac739e05

View File

@ -1518,7 +1518,10 @@ static void simplify_merges(struct rev_info *revs)
struct commit_list *list;
struct commit_list *yet_to_do, **tail;
sort_in_topological_order(&revs->commits, revs->lifo);
if (!revs->topo_order)
sort_in_topological_order(&revs->commits, revs->lifo);
if (!revs->prune)
return;
/* feed the list reversed */
yet_to_do = NULL;