Code

revision --simplify-merges: make it a no-op without pathspec
authorJunio C Hamano <gitster@pobox.com>
Thu, 14 Aug 2008 20:52:36 +0000 (13:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Aug 2008 07:39:47 +0000 (00:39 -0700)
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>
revision.c

index 8cd39da2effa144721851097afe6d503e3c255e1..db2ab2b11a39c295373488f6ff28c1340a9a666d 100644 (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;