# [PATCH 3/7] Fixes problem with --merge-order head ^head

1 messages from 2005-06-20 to 2005-06-20. Participants: Jon Seymour.
Thread: https://gitlist.dev/t/983

## Jon Seymour, 2005-06-20 02:29

Subject: [PATCH 3/7] Fixes problem with --merge-order head ^head
Message-ID: <20050620022931.28578.qmail@blackcubes.dyndns.org>
URL: https://gitlist.dev/e/20050620022931.28578.qmail%40blackcubes.dyndns.org

```

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>
---

 epoch.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/epoch.c b/epoch.c
--- a/epoch.c
+++ b/epoch.c
@@ -606,7 +606,9 @@ int sort_list_in_merge_order(struct comm
 		}
 	}
 
-	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.
------------

```
