summaryrefslogtreecommitdiff
path: root/t/t2017-checkout-orphan.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t2017-checkout-orphan.sh')
-rwxr-xr-xt/t2017-checkout-orphan.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index 0e3b8582f2..655f278c5f 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -116,4 +116,10 @@ test_expect_success '--orphan refuses to switch if a merge is needed' '
git reset --hard
'
+test_expect_success 'cannot --detach on an unborn branch' '
+ git checkout master &&
+ git checkout --orphan new &&
+ test_must_fail git checkout --detach
+'
+
test_done