aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-22 13:00:31 -0700
committerJunio C Hamano <gitster@pobox.com>2012-07-22 13:00:32 -0700
commit9ea5c632da283ff8c2dea8176cd34f1c8618d6c4 (patch)
tree98c421927ea754c8eeb2733a5ec7dc09825a1cdc /t
parentbb3ed291a6cfd4ed58773f2158f3ae32baf066e0 (diff)
parent8ced1aa08f9e1798b2b3fec41a0598ef79b477fe (diff)
downloadgit-9ea5c632da283ff8c2dea8176cd34f1c8618d6c4.tar.gz
git-9ea5c632da283ff8c2dea8176cd34f1c8618d6c4.tar.xz
Merge branch 'cw/no-detaching-an-unborn' into maint
"git checkout --detach", when you are still on an unborn branch, should be forbidden, but it wasn't. * cw/no-detaching-an-unborn: git-checkout: disallow --detach on unborn branch
Diffstat (limited to 't')
-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 0e3b8582f..655f278c5 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