[PATCH] Fixes problem with --merge-order head ^head
authorJon Seymour <jon.seymour@gmail.com>
Mon, 20 Jun 2005 02:29:31 +0000 (12:29 +1000)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 20 Jun 2005 03:13:18 +0000 (20:13 -0700)
git-rev-list --merge-order HEAD ^HEAD was faulting rather than generating an empty output.

This patch fixes that problem.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
epoch.c

diff --git a/epoch.c b/epoch.c
index 5b71ad5..82becf6 100644 (file)
--- a/epoch.c
+++ b/epoch.c
@@ -606,7 +606,9 @@ int sort_list_in_merge_order(struct commit_list *list, emitter_func emitter)
                }
        }
 
-       if (!reversed->next) {
+       if (!reversed)
+               return ret;
+       else if (!reversed->next) {
                /*
                 * If there is only one element in the list, we can sort it
                 * using sort_in_merge_order.