t1510: setup case #11
[gitweb.git] / t / t2018-checkout-branch.sh
index 1caffeac074ed9a8e434a3d6e53c20b00e8672cc..fa69016381b0196c49472af51e36948ec7c5a2a9 100755 (executable)
@@ -124,6 +124,12 @@ test_expect_success 'checkout -B to an existing branch resets branch to HEAD' '
        do_checkout branch2 "" -B
 '
 
+test_expect_success 'checkout -B to an existing branch from detached HEAD resets branch to HEAD' '
+       git checkout $(git rev-parse --verify HEAD) &&
+
+       do_checkout branch2 "" -B
+'
+
 test_expect_success 'checkout -B to an existing branch with an explicit ref resets branch to that ref' '
        git checkout branch1 &&