Code

MinGW: GCC >= 4 does not need SNPRINTF_SIZE_CORR anymore
[git.git] / t / t7201-co.sh
index 0e21632f19e75e1e7bbca1ceb2b9402a4d291584..ebfd34df36068f8808406a98d371731fb85012c4 100755 (executable)
@@ -171,7 +171,7 @@ test_expect_success 'checkout to detach HEAD' '
        git checkout -f renamer && git clean -f &&
        git checkout renamer^ 2>messages &&
        (cat >messages.expect <<EOF
-Note: moving to "renamer^" which isn'"'"'t a local branch
+Note: moving to '\''renamer^'\'' which isn'\''t a local branch
 If you want to create a new branch from this checkout, you may do so
 (now or later) by using -b with the checkout command again. Example:
   git checkout -b <new_branch_name>
@@ -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