From e4b09dad9f65395fd4bb8ab165012a3a6698a75b Mon Sep 17 00:00:00 2001
From: Nanako Shiraishi <nanako3@lavabit.com>
Date: Sun, 17 May 2009 11:43:08 +0900
Subject: [PATCH] test: checkout shouldn't say that HEAD has moved if it didn't
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: しらいしななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t7201-co.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index bdb808af1a..ebfd34df36 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -534,4 +534,12 @@ test_expect_success 'failing checkout -b should not break working tree' '
 
 '
 
+test_expect_success 'switch out of non-branch' '
+	git reset --hard master &&
+	git checkout master^0 &&
+	echo modified >one &&
+	test_must_fail git checkout renamer 2>error.log &&
+	! grep "^Previous HEAD" error.log
+'
+
 test_done